Changeset 30095 in osm for applications/editors/josm/plugins
- Timestamp:
- 2013-11-25T01:37:04+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/MifReader.java
r28891 r30095 458 458 String midLine = midReader.readLine(); 459 459 if (midLine != null) { 460 String[] fields = OdUtils.stripQuotes (midLine.split(delimiter.toString()), delimiter.toString());460 String[] fields = OdUtils.stripQuotesAndExtraChars(midLine.split(delimiter.toString()), delimiter.toString()); 461 461 if (columns.size() != fields.length) { 462 462 System.err.println("Error: Incoherence between MID and MIF files ("+columns.size()+" columns vs "+fields.length+" fields)"); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/CsvReader.java
r29666 r30095 80 80 private final String[] splitLine() { 81 81 if (line != null) { 82 return OdUtils.stripQuotes (line.split(sep), sep);82 return OdUtils.stripQuotesAndExtraChars(line.split(sep), sep); 83 83 } else { 84 84 return null; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java
r29107 r30095 21 21 import java.util.ArrayList; 22 22 import java.util.List; 23 import java.util.ListIterator; 23 24 import java.util.Locale; 24 25 … … 31 32 import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleHandler; 32 33 import org.openstreetmap.josm.tools.ImageProvider; 34 import org.openstreetmap.josm.tools.Utils; 33 35 34 36 public abstract class OdUtils { … … 40 42 } 41 43 42 public static final String[] stripQuotes (String[] split, String sep) {44 public static final String[] stripQuotesAndExtraChars(String[] split, String sep) { 43 45 List<String> result = new ArrayList<String>(); 44 46 boolean append = false; … … 58 60 result.add(split[i]); 59 61 } 62 } 63 // Remove exotic characters such as U+FEFF found in some CSV files 64 for (ListIterator<String> it = result.listIterator(); it.hasNext();) { 65 it.set(Utils.strip(it.next())); 60 66 } 61 67 return result.toArray(new String[0]);
Note:
See TracChangeset
for help on using the changeset viewer.