GNOME Bugzilla – Bug 707792
the returned country code is in lowercase
Last modified: 2013-09-16 20:35:08 UTC
the reverse geocoding returns for example for Italy: "it" instead of "IT".
(In reply to comment #0) > the reverse geocoding returns for example for Italy: "it" instead of "IT". 1. AFAIK that is not wrong, do prove me wrong please. :) 2. We take them as-is from Nominatim so you'll have to get them corrected there. While you can directly correct them in openstreetmap editors, I'd advise you to contact OSM folks on irc/list first to get their input.
there is an iso standard for a country code see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 also you have probably seen sometimes strings like "en_US.UTF-8" :) or compare additionally with the libgweather libtary or freeip.org service
(In reply to comment #2) > there is an iso standard for a country code see > http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 > > also you have probably seen sometimes strings like "en_US.UTF-8" :) Yes, they usually appear in uppercase but where does it say that they must?
Created attachment 254529 [details] [review] lib: Force lower-case country codes Whether or not country-codes should be upper- or lower-case is really a matter of tastes, and uses. Always return country codes as lower-case and document that. Applications that require upper-case codes can upper-case it easily through GLib helpers.
Review of attachment 254529 [details] [review]: If we are going to standardize in the lib, I'd rather we use the most common format: uppercase.
How is upper case the most common format? The only place I can think of that uses upper case is locale.
(In reply to comment #6) > How is upper case the most common format? The only place I can think of that > uses upper case is locale. Evgeny provided 2 (3 actually if you count the country codes shown on wikipedia article) examples in comment#1.
Created attachment 255052 [details] [review] 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.
Review of attachment 255052 [details] [review]: ack
This was a tiny issue, or rather an enhancement, but in the same time a good sign for a well supported library. Thanks.