Changeset 3372 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-07-09T13:38:41+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GpxImporter.java
r3083 r3372 37 37 is = new FileInputStream(file); 38 38 } 39 // Workaround for SAX BOM bug40 // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=620683541 if (!((is.read() == 0xef) && (is.read() == 0xbb) && (is.read() == 0xbf))) {42 is.close();43 if (file.getName().endsWith(".gpx.gz")) {44 is = new GZIPInputStream(new FileInputStream(file));45 } else {46 is = new FileInputStream(file);47 }48 }49 39 final GpxReader r = new GpxReader(is); 50 40 final boolean parsedProperly = r.parse(true); -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r2907 r3372 355 355 */ 356 356 public GpxReader(InputStream source) throws IOException { 357 this.inputSource = new InputSource( new InputStreamReader(source, "UTF-8"));357 this.inputSource = new InputSource(UTFInputStreamReader.create(source, "UTF-8")); 358 358 } 359 359 -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r3226 r3372 1 // License: GPL. See LICENSE file for details. 1 2 package org.openstreetmap.josm.io; 2 3 … … 4 5 5 6 import java.io.InputStream; 6 import java.io.InputStreamReader;7 7 import java.text.MessageFormat; 8 8 import java.util.ArrayList; … … 570 570 progressMonitor.beginTask(tr("Prepare OSM data...", 2)); 571 571 progressMonitor.indeterminateSubTask(tr("Parsing OSM data...")); 572 InputSource inputSource = new InputSource(new InputStreamReader(source, "UTF-8")); 572 573 InputSource inputSource = new InputSource(UTFInputStreamReader.create(source, "UTF-8")); 573 574 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, reader.new Parser()); 574 575 progressMonitor.worked(1);
Note:
See TracChangeset
for help on using the changeset viewer.