Opened 5 years ago
Closed 4 years ago
#1772 closed defect (fixed)
[PATCH] GPX files written by JOSM have wrong encoding
| Reported by: | anonymous | Owned by: | framm |
|---|---|---|---|
| Priority: | minor | Component: | Core |
| Version: | latest | Keywords: | |
| Cc: |
Description
I came across this as gpsbabel choked on a a gpx file exported by JOSM.
The xml header says encoding='UTF-8' but the data actually is ISO 8859-1, e.g in "<name>Dorfstraße</name>".
So encoding should either contain the real encoding or more desirable the file should encoded in UTF-8.
Tested with JOSM 1081 on Windows.
Attachments (1)
Change History (5)
comment:1 Changed 4 years ago by anonymous
- Summary changed from GPX files written by JOSM have wrong encoding to [PATCH] GPX files written by JOSM have wrong encoding
Changed 4 years ago by anonymous
comment:2 Changed 4 years ago by robome@…
I've played a bit with the source and changed GpxWriter to be used like OsmWriter. That needs much more code to be touched but at least if OsmWriter is considered a good implementation the result might be desirable.
comment:3 Changed 4 years ago by robome@…
Sorry, I can't attach the patch because it always gets rejected as potential spam. That's not nice.
comment:4 Changed 4 years ago by anonymous
- Resolution set to fixed
- Status changed from new to closed
Patch applied in r1114.



The GpxWriter class uses an PrintWriter instance which uses the default encoding. On Windows the default encoding is not UTF-8 therefore the encoding problem.
The attached patch corrects this.