[geocode-glib] lib: Fix reverse geocoding in French locale



commit a186db7c090bf669131cfdc68110578b46cac346
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 5 12:40:56 2011 +0100

    lib: Fix reverse geocoding in French locale
    
    Use g_ascii_formatd() to avoid problems when the locale uses ","
    to separate decimals.
    
    Reported by Guillaume Desmottes.

 geocode-glib/geocode-glib.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/geocode-glib/geocode-glib.c b/geocode-glib/geocode-glib.c
index 8c861e8..c91b5e2 100644
--- a/geocode-glib/geocode-glib.c
+++ b/geocode-glib/geocode-glib.c
@@ -169,6 +169,7 @@ geocode_object_new_for_coords (gdouble     latitude,
 			       gdouble     longitude)
 {
 	GeocodeObject *object;
+	char buf[16], buf2[16];
 
 	g_return_val_if_fail (longitude >= -180.0 && longitude <= 180.0, NULL);
 	g_return_val_if_fail (latitude >= -90.0 && latitude <= 90.0, NULL);
@@ -178,7 +179,9 @@ geocode_object_new_for_coords (gdouble     latitude,
 
 	g_hash_table_insert (object->priv->ht,
 			     g_strdup ("location"),
-			     g_strdup_printf ("%g, %g", latitude, longitude));
+			     g_strdup_printf ("%s, %s",
+					      g_ascii_formatd (buf, sizeof (buf), "%g", latitude),
+					      g_ascii_formatd (buf2, sizeof (buf2), "%g", longitude)));
 
 	return object;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]