Modify

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 Don-vip)

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)

nok.gpx (1.7 KB ) - added by anonymous 11 years ago.
ok.gpx (893 bytes ) - added by anonymous 11 years ago.
8893-dirtyfix.patch (982 bytes ) - added by AlfonZ 11 years ago.

Download all attachments as: .zip

Change History (9)

by anonymous, 11 years ago

Attachment: nok.gpx added

by anonymous, 11 years ago

Attachment: ok.gpx added

comment:1 by Don-vip, 11 years ago

Description: modified (diff)
Keywords: gpx added
Summary: Defektes GPX FileCannot load GPX file

comment:2 by Don-vip, 11 years ago

Keywords: utf-16 added
Resolution: othersoftware
Status: newclosed

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" ?)

comment:3 by anonymous, 11 years ago

Resolution: othersoftware
Status: closedreopened

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 AlfonZ, 11 years ago

Attachment: 8893-dirtyfix.patch added

in reply to:  3 comment:4 by AlfonZ, 11 years ago

I see two things here.

  1. 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.

    It is common practice to offer leeway with malformed files. You see it as a bug in JOSM, I see it as a feature in other editors.
  1. 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.

in reply to:  2 comment:5 by bastiK, 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.

comment:6 by bastiK, 11 years ago

Resolution: othersoftwarefixed

In 6080/josm:

fixed #8893 - Cannot load GPX file

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.