Modify

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)

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

Download all attachments as: .zip

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

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.

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.