Changeset 5749 in josm
- Timestamp:
- 2013-03-02T00:51:28+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GeoJSONExporter.java
r5361 r5749 2 2 package org.openstreetmap.josm.io; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.io.BufferedWriter; 4 7 import java.io.File; 5 import java.io.File Writer;8 import java.io.FileOutputStream; 6 9 import java.io.IOException; 10 import java.io.OutputStreamWriter; 11 import java.io.Writer; 12 7 13 import org.openstreetmap.josm.actions.ExtensionFileFilter; 8 14 import org.openstreetmap.josm.gui.layer.Layer; 9 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 10 import static org.openstreetmap.josm.tools.I18n.tr;11 16 12 17 public class GeoJSONExporter extends FileExporter { … … 23 28 if (layer instanceof OsmDataLayer) { 24 29 String json = new GeoJSONWriter((OsmDataLayer) layer).write(); 25 FileWriter out = new FileWriter(file); 26 out.write(json); 27 out.close(); 30 Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); 31 try { 32 out.write(json); 33 } finally { 34 out.close(); 35 } 28 36 } else { 29 37 throw new IllegalArgumentException(tr("Layer ''{0}'' not supported", layer.getClass().toString()));
Note:
See TracChangeset
for help on using the changeset viewer.