GNOME Bugzilla – Bug 706786
geocode-reverse constructor is not locale safe
Last modified: 2013-08-26 17:37:38 UTC
The constructor new_for_location does: g_strdup_printf ("%g", geocode_location_get_latitude (location))); For latitude and location. With my locale sv_SE this will give a string with a comma as decimal point, which will break stuff. Reverse geocoding in maps did not work for me on one system unless i did LC_NUMERIC="en_US.UTF-8". This should be fixed to be locale safe.
Created attachment 253105 [details] [review] geocode-reverse: Make constructor locale safe When using g_strdup_printf and float values the radix character (decimal point) is locale dependent and for some locales will print a comma. This will break the nominatim queries for us. Switch to using g_ascii_dtostr() instead which will always use a dot as decimal point.
Created attachment 253106 [details] [review] geocode-reverse: Make constructor locale safe v2 Now without debug g_printf
Created attachment 253128 [details] [review] geocode-reverse: Make constructor locale safe v3 And now without whitespace damage!