Changeset 13619 in josm for trunk/scripts
- Timestamp:
- 2018-04-12T09:27:35+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13593 r13619 102 102 cli.q(longOpt:'josmxml', args:1, argName:"josmxml", "JOSM entries reoutput as XML file (incomplete)") 103 103 cli.m(longOpt:'noeli', argName:"noeli", "don't show output for ELI problems") 104 cli.c(longOpt:'encoding', args:1, argName:"encoding", "output encoding (defaults to UTF-8 or cp850 on Windows)") 104 105 cli.h(longOpt:'help', "show this help") 105 106 options = cli.parse(args) … … 119 120 } 120 121 if (options.output && options.output != "-") { 122 String ccp = options.encoding 123 if (ccp == null) 124 ccp = "UTF-8" 121 125 outputFile = new FileOutputStream(options.output) 122 outputStream = new OutputStreamWriter(outputFile, "UTF-8") 126 outputStream = new OutputStreamWriter(outputFile, ccp) 127 } else { 128 String ccp = options.encoding 129 if (ccp == null) { 130 String osn = System.getProperty("os.name") 131 ccp = (osn != null && osn.contains("Windows")) ? "cp850" : "UTF-8" 132 } 133 outputStream = new OutputStreamWriter(System.out, ccp) 123 134 } 124 135 } … … 206 217 207 218 void loadELIEntries() { 208 FileReader fr = new FileReader(eliInputFile)219 def fr = new InputStreamReader(new FileInputStream(eliInputFile), "UTF-8") 209 220 JsonReader jr = Json.createReader(fr) 210 221 eliEntries = jr.readObject().get("features")
Note:
See TracChangeset
for help on using the changeset viewer.