Ticket #1100: nokiabug.patch
| File nokiabug.patch, 1.6 KB (added by , 17 years ago) |
|---|
-
src/org/openstreetmap/josm/io/GpxReader.java
57 57 58 58 private StringBuffer accumulator = new StringBuffer(); 59 59 60 private boolean nokiaSportsTrackerBug = false; 61 60 62 @Override public void startDocument() { 61 63 accumulator = new StringBuffer(); 62 64 states = new Stack<state>(); … … 98 100 } else if (qName.equals("extensions")) { 99 101 states.push(currentState); 100 102 currentState = state.ext; 103 } else if (qName.equals("gpx") && atts.getValue("creator").startsWith("Nokia Sports Tracker")) { 104 nokiaSportsTrackerBug = true; 101 105 } 102 106 break; 103 107 case author: … … 177 181 } 178 182 179 183 @Override public void characters(char[] ch, int start, int length) { 184 /** 185 * Remove illegal characters generated by the Nokia Sports Tracker device. 186 * Don't do this crude substitution for all files, since it would destroy 187 * certain unicode characters. 188 */ 189 if (nokiaSportsTrackerBug) { 190 for (int i=0; i<ch.length; ++i) { 191 if (ch[i] == 1) { 192 ch[i] = 32; 193 } 194 } 195 nokiaSportsTrackerBug = false; 196 } 197 180 198 accumulator.append(ch, start, length); 181 199 } 182 200
