Opened 11 years ago
Last modified 11 years ago
#8893 closed defect (fixed)
Cannot load GPX file
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | gpx utf-16 | Cc: |
Description (last modified by )
Hi, I have some defective GPX files that JOSM can not load. Please find attached a file which goes well and one which goes wrong. Both have the same content.
Attachments (3)
Change History (9)
by , 11 years ago
by , 11 years ago
comment:1 by , 11 years ago
Description: | modified (diff) |
---|---|
Keywords: | gpx added |
Summary: | Defektes GPX File → Cannot load GPX file |
follow-up: 5 comment:2 by , 11 years ago
Keywords: | utf-16 added |
---|---|
Resolution: | → othersoftware |
Status: | new → closed |
follow-up: 4 comment:3 by , 11 years ago
Resolution: | othersoftware |
---|---|
Status: | closed → reopened |
Why is the status now "cloded"?
JOSM DONT WORK.
Both Files could be read with any editor. Only JOSM coult not read it. Maybe the file is not 100% correct, but its an JOSM BUG, if any other programm can read the file without problems.
Its a file from a:drake.
by , 11 years ago
Attachment: | 8893-dirtyfix.patch added |
---|
comment:4 by , 11 years ago
I see two things here.
- The file is not 100% correctly formed xml and this should be fixed in the creating program.
Replying to anonymous:Both Files could be read with any editor. Only JOSM coult not read it. Maybe the file is not 100% correct, but its an JOSM BUG, if any other programm can read the file without problems.
- As stated by Don-vip, there are known problems with UTF-16 in JOSM.
I accidentally tried it to open the file in quite old JOSM and it worked. It seems that the behavior changed in r5854. I tried quick dirty fix and it helped, however its consequences need to be carefully considered.
comment:5 by , 11 years ago
Replying to Don-vip:
Your first file is encoded in UTF-16 but said to be encoded in UTF-8.
We have some problems with UTF-16 (see #3290), but you shoud file the bug to the program that created this wrong file ("GPS Master" ?)
The byte order mark is correct, so it should work. The problem is, that we filter invalid characters from the byte stream and afterwards encode to a character stream: GpxReader.java#L428
0x00 is valid as part of the UTF-16 byte stream, but not as an encoded xml-character, so we should filter after encoding.
Your first file is encoded in UTF-16 but said to be encoded in UTF-8.
We have some problems with UTF-16 (see #3290), but you shoud file the bug to the program that created this wrong file ("GPS Master" ?)