After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707792 - the returned country code is in lowercase
the returned country code is in lowercase
Status: RESOLVED FIXED
Product: geocode-glib
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: geocode-glib maintainer(s)
geocode-glib maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-09 18:05 UTC by Evgeny Bobkin
Modified: 2013-09-16 20:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
lib: Force lower-case country codes (1.38 KB, patch)
2013-09-09 22:58 UTC, Bastien Nocera
none Details | Review
lib: Force upper-case country codes (1.55 KB, patch)
2013-09-16 17:42 UTC, Bastien Nocera
accepted-commit_now Details | Review

Description Evgeny Bobkin 2013-09-09 18:05:51 UTC
the reverse geocoding returns for example for Italy: "it" instead of "IT".
Comment 1 Zeeshan Ali 2013-09-09 18:11:32 UTC
(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.
Comment 2 Evgeny Bobkin 2013-09-09 18:29:30 UTC
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
Comment 3 Zeeshan Ali 2013-09-09 19:35:20 UTC
(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?
Comment 4 Bastien Nocera 2013-09-09 22:58:41 UTC
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.
Comment 5 Zeeshan Ali 2013-09-09 23:18:42 UTC
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.
Comment 6 Bastien Nocera 2013-09-10 01:48:34 UTC
How is upper case the most common format? The only place I can think of that uses upper case is locale.
Comment 7 Zeeshan Ali 2013-09-10 01:53:53 UTC
(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.
Comment 8 Bastien Nocera 2013-09-16 17:42:30 UTC
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.
Comment 9 Zeeshan Ali 2013-09-16 17:50:10 UTC
Review of attachment 255052 [details] [review]:

ack
Comment 10 Evgeny Bobkin 2013-09-16 20:35:08 UTC
This was a tiny issue, or rather an enhancement, but in the same time a good sign for a well supported library. Thanks.