[geocode-glib] lib: Force upper-case country codes
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geocode-glib] lib: Force upper-case country codes
- Date: Mon, 16 Sep 2013 17:49:05 +0000 (UTC)
commit b2d1aa2dd821ec1674a52979bde3821ff1892e1a
Author: Bastien Nocera <hadess hadess net>
Date: Mon Sep 9 19:53:57 2013 -0300
lib: Force upper-case country codes
Always return upper-case country codes as, even if both are
correct, the ISO itself shows country codes in upper-case:
http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm
and language codes in lower-case:
http://www.loc.gov/standards/iso639-2/php/code_list.php
Applications that require lower-case codes can upper-case it
easily through GLib helpers.
https://bugzilla.gnome.org/show_bug.cgi?id=707792
geocode-glib/geocode-place.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/geocode-glib/geocode-place.c b/geocode-glib/geocode-place.c
index 6eaa094..c21028c 100644
--- a/geocode-glib/geocode-place.c
+++ b/geocode-glib/geocode-place.c
@@ -961,16 +961,16 @@ geocode_place_set_country_code (GeocodePlace *place,
g_return_if_fail (country_code != NULL);
g_free (place->priv->country_code);
- place->priv->country_code = g_strdup (country_code);
+ place->priv->country_code = g_utf8_strup (country_code, -1);
}
/**
* geocode_place_get_country_code:
* @place: A place
*
- * Gets the ISO country code of the @place.
+ * Gets the ISO-3166 country code of the @place.
*
- * Returns: The ISO country code of the @place.
+ * Returns: The ISO-3166 country code of the @place, in upper case.
**/
const char *
geocode_place_get_country_code (GeocodePlace *place)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]