Author Topic: Encoding error in gpx tracklog  (Read 1668 times)

αdαmsκι

  • Instagram @ucfaaay Strava @ucfaaay
  • Look haggard. It sells.
Encoding error in gpx tracklog
« on: 10 May, 2015, 02:02:47 pm »
This is confusing. I've got some gpx tracklog files (ie files removed from my Garmin Etrex 20 showing where I've ridden). The files from the Garmin will happily upload to bikehike, ridewithgps etc., but if I simply copy the text into another text editor (such as Kate, notepad or gedit) and save the file, making sure to change the extension to .gpx, it won't upload to bikehike, ridewithgps etc. I've made absolutely no changes to the data. I'm running Linux Mint. Any idea what the issue is because it's doing my head in?
What on earth am I doing here on this beautiful day?! This is the only life I've got!!

https://tyredandhungry.wordpress.com/

Feanor

  • It's mostly downhill from here.
Re: Encoding error in gpx tracklog
« Reply #1 on: 10 May, 2015, 02:13:17 pm »
Is it due to the fact that the Linux-based editor is replacing the MS-DOS / Windows end-of-line characters with Unix-style ones on saving?
That's the major difference between text files in the DOS / Windows world and the Unix world.

See if your editors have options relating to that.
Configure the editor not to 'automatically convert' to UNIX format or whatever, and leave them in the original format.

vorsprung

  • Opposites Attract
    • Audaxing
Re: Encoding error in gpx tracklog
« Reply #2 on: 10 May, 2015, 02:18:49 pm »
After I edit gpx files by hand I always use an XML validator program on them

ISTR mint is a Debian variant so "apt-get install libxml2-utils" should give you a program "xmllint" (yes with two L)  run this from a shell with the -noout option on your file
and it will show the errors

fuaran

  • rothair gasta
Re: Encoding error in gpx tracklog
« Reply #3 on: 10 May, 2015, 02:20:48 pm »
Or the wrong character encoding. The first line of the GPX file should be an XML tag that specifies the encoding.
eg
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
I think this will usually be UTF-8. So make sure your text editor is set to save as that encoding.

αdαmsκι

  • Instagram @ucfaaay Strava @ucfaaay
  • Look haggard. It sells.
Re: Encoding error in gpx tracklog
« Reply #4 on: 10 May, 2015, 02:26:54 pm »
Kate does have options relating to end of line characters, but changing it to Windows still results in the same issue.

Encoding is UTF-8.

I am confused.com ???


Given up for the moment & used the old Windows laptop to edit the tracklog.
What on earth am I doing here on this beautiful day?! This is the only life I've got!!

https://tyredandhungry.wordpress.com/

Feanor

  • It's mostly downhill from here.
Re: Encoding error in gpx tracklog
« Reply #5 on: 10 May, 2015, 03:40:55 pm »
Then can you do a binary compare of the file before and after editing, and see what's being messed up?

αdαmsκι

  • Instagram @ucfaaay Strava @ucfaaay
  • Look haggard. It sells.
Re: Encoding error in gpx tracklog
« Reply #6 on: 10 May, 2015, 10:33:41 pm »
I can't see anything amiss upon visual inspection.
What on earth am I doing here on this beautiful day?! This is the only life I've got!!

https://tyredandhungry.wordpress.com/

Feanor

  • It's mostly downhill from here.
Re: Encoding error in gpx tracklog
« Reply #7 on: 10 May, 2015, 11:36:11 pm »
Yes, that's why a binary comparison is required.
The difference will be in the characters you can't see, not the ones you can.

If you are able to make 2 file available for comparison ( an original that works, and one which has simply been load-saved with no other modification in an editor that does not ) then I'd be happy to do a binary / hex compare and determine the difference.

And I'm betting a marzipan hat it is related to EOL characters.
And I hate marzipan.





frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Encoding error in gpx tracklog
« Reply #8 on: 18 May, 2015, 11:24:53 pm »
Sometimes it's as simple as a c/r added to the end of the file.  Though BikeHike is usually pretty tolerant of dodgy files.
when you're dead you're done, so let the good times roll

αdαmsκι

  • Instagram @ucfaaay Strava @ucfaaay
  • Look haggard. It sells.
Re: Encoding error in gpx tracklog
« Reply #9 on: 19 September, 2015, 08:44:15 pm »
Well I am now running the latest version of Mint and Sublime text editor and all is good. Thanks for the various tips.
What on earth am I doing here on this beautiful day?! This is the only life I've got!!

https://tyredandhungry.wordpress.com/