From 021370e3bf24ffdbf22e7d168a7487d51c519d93 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 28 Sep 2014 19:18:04 +0200 Subject: freebase: Fix locale-dependent issues in geolocated queries Latitude/longitude are really expected with a '.' decimal point by the service, breaking on locales that would use anything different. Use g_ascii_formatd which always uses the '.' decimal point. https://bugzilla.gnome.org/show_bug.cgi?id=737541 --- gdata/services/freebase/gdata-freebase-search-query.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdata/services/freebase/gdata-freebase-search-query.c b/gdata/services/freebase/gdata-freebase-search-query.c index 4d6badb4..4c666fd2 100644 --- a/gdata/services/freebase/gdata-freebase-search-query.c +++ b/gdata/services/freebase/gdata-freebase-search-query.c @@ -246,9 +246,15 @@ build_filter_string (FilterNode *node, break; } case NODE_LOCATION: - g_string_append_printf (str, "(within radius:%" G_GUINT64_FORMAT "m lon:%.4f lat:%.4f)", - node->location.radius, node->location.lon, node->location.lat); + { + gchar lon_str[G_ASCII_DTOSTR_BUF_SIZE], lat_str[G_ASCII_DTOSTR_BUF_SIZE]; + + g_ascii_formatd (lon_str, G_ASCII_DTOSTR_BUF_SIZE, "%.4f", node->location.lon); + g_ascii_formatd (lat_str, G_ASCII_DTOSTR_BUF_SIZE, "%.4f", node->location.lat); + g_string_append_printf (str, "(within radius:%" G_GUINT64_FORMAT "m lon:%s lat:%s)", + node->location.radius, lon_str, lat_str); break; + } default: g_assert_not_reached (); break; -- cgit v1.2.1