Modify

Opened 16 years ago

Closed 16 years ago

#1772 closed defect (fixed)

[PATCH] GPX files written by JOSM have wrong encoding

Reported by: anonymous Owned by: framm
Priority: minor Milestone:
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)

GPX_UTF8_patch.txt (1.3 KB ) - added by anonymous 16 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by anonymous, 16 years ago

Summary: GPX files written by JOSM have wrong encoding[PATCH] GPX files written by JOSM have wrong encoding

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.

by anonymous, 16 years ago

Attachment: GPX_UTF8_patch.txt added

comment:2 by robome@…, 16 years ago

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 by robome@…, 16 years ago

Sorry, I can't attach the patch because it always gets rejected as potential spam. That's not nice.

comment:4 by anonymous, 16 years ago

Resolution: fixed
Status: newclosed

Patch applied in r1114.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.