Changeset 12066 in josm


Ignore:
Timestamp:
2017-05-05T21:50:01+02:00 (21 months ago)
Author:
stoecker
Message:

see #14655 - enforce UTF-8 for output in files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r12061 r12066  
    3939    static String josmInputFile = 'imagery_josm.imagery.xml'
    4040    static String ignoreInputFile = 'imagery_josm.ignores.txt'
    41     static FileWriter outputFile = null
    42     static BufferedWriter outputStream = null
     41    static FileOutputStream outputFile = null
     42    static OutputStreamWriter outputStream = null
    4343    def skip = [:]
    4444
     
    5656        script.loadJosmEntries()
    5757        if(options.josmxml) {
    58             def file = new FileWriter(options.josmxml)
    59             def stream = new BufferedWriter(file)
     58            def file = new FileOutputStream(options.josmxml)
     59            def stream = new OutputStreamWriter(file, "UTF-8")
    6060            script.printentries(script.josmEntries, stream)
     61            stream.close();
     62            file.close();
    6163        }
    6264        script.loadELIEntries()
    6365        if(options.elixml) {
    64             def file = new FileWriter(options.elixml)
    65             def stream = new BufferedWriter(file)
     66            def file = new FileOutputStream(options.elixml)
     67            def stream = new OutputStreamWriter(file, "UTF-8")
    6668            script.printentries(script.eliEntries, stream)
     69            stream.close();
     70            file.close();
    6771        }
    6872        script.checkInOneButNotTheOther()
     
    110114        }
    111115        if (options.output && options.output != "-") {
    112             outputFile = new FileWriter(options.output)
    113             outputStream = new BufferedWriter(outputFile)
     116            outputFile = new FileOutputStream(options.output)
     117            outputStream = new OutputStreamWriter(outputFile, "UTF-8")
    114118        }
    115119    }
Note: See TracChangeset for help on using the changeset viewer.