scubajorgen / TomTomWatch

Tool for exporting GPS files from TomTom Sports Watches
75 stars 16 forks source link

gpx export uses ',' instead of '.' on MS Windows Germany. #14

Open machinaeXlasse opened 5 years ago

machinaeXlasse commented 5 years ago

I always failed using the gpx files exported by TomTomWatch when running it on Windows so I used another tool for that. Now I took a closer look at my exported gpx files and figured, that all floating point values contain a comma , instead of . Replacing all , by . actually repaired the file.

I can only guess, as weird as it sounds, that this has somehow to do with MS Windows location settings. From a german notation perspective using ',' for floating point is perfectly accurate as long as you write prose and not computable files.

Unfortunatly changing location to United Kingdom in General Settings didn't help. But maybe there are other location settings that are accountable for this. I will try more if I find the time.

Maybe you have an idea how this can be fixed.

Thanks again for creating this software!

machinaeXlasse commented 5 years ago

Here is an example file: run_20190308_description.zip

scubajorgen commented 5 years ago

Thank you for notifying. I use gson, a JSON lib from Google. Apparently it takes the locale into account. This really is a pain in the ass. I will check if I can set it to ignore the locale and always use a dot. Though I am a dutchy I set my computers to use the English locale, just to prevent this kind of shit. Therefore I did not notice so far...

scubajorgen commented 5 years ago

I cannot reproduce. Not by setting Windows Locale (excel uses , iso . but not TomTomWatch), not by setting the JVM locale. Please could you test attached jar file? I set the locale in it to EN/US

TomTomWatch-1.5.jar.zip

sbouth commented 4 years ago

@scubajorgen I'm not sure what do you think but on my android app I have modified all String.format call to force a locale.

for example:

│-            attr.setValue(String.format("%.7f", latitude));
│+            attr.setValue(String.format(Locale.US, "%.7f", latitude));