dcaliste / maep-qt

A map viewer for Jolla Sailfish OS
29 stars 14 forks source link

save track h_acc via g_ascii_dtostr to avoid , as decimal seperator #30

Closed merlin1991 closed 5 years ago

merlin1991 commented 5 years ago

On my device which has a de_DE locale the track files have invalid xml for h_acc like this fake sample:

<trkpt lat="99.9999999" lon="99.9999999">
        <ele>999.99</ele>
                <extensions>
                        <h_acc>99,999</h_acc>
                </extensions>
        <time>2019-06-16T00:00:00</time>
</trkpt>

which is due to the use of g_strdup_printf in the track saving code https://github.com/dcaliste/maep-qt/blob/84f440c3b817f27762ab8938453de46b438e51a3/src/track.c#L722-L726 Interestingly the code responsible of loading track points is already using the right g_ascii_strtod call https://github.com/dcaliste/maep-qt/blob/84f440c3b817f27762ab8938453de46b438e51a3/src/track.c#L396-L401

dcaliste commented 5 years ago

Good catch. Looks fine. Thank you very much.