This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v2] localedata: CLDRv29: update LC_ADDRESS.country_num values
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, Andreas Schwab <schwab at suse dot de>
- Cc: Chris Leonard <cjlhomeaddress at gmail dot com>, Marko Myllynen <myllynen at redhat dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 13 Apr 2016 12:27:19 -0400
- Subject: Re: [PATCH v2] localedata: CLDRv29: update LC_ADDRESS.country_num values
- Authentication-results: sourceware.org; auth=none
- References: <1455939430-19704-1-git-send-email-vapier at gentoo dot org> <1460443470-14172-1-git-send-email-vapier at gentoo dot org> <mvmwpo3uut3 dot fsf at hawking dot suse dot de> <20160412075804 dot GS6588 at vapier dot lan> <mvmshyruua8 dot fsf at hawking dot suse dot de> <20160412081337 dot GT6588 at vapier dot lan> <mvmoa9futoo dot fsf at hawking dot suse dot de> <20160412082527 dot GV6588 at vapier dot lan> <mvmk2k3ut49 dot fsf at hawking dot suse dot de> <570CB29A dot 6070105 at redhat dot com> <mvmfuurusuj dot fsf at hawking dot suse dot de> <CAHdAatYwoRPqb3go3gYOTB9i-VMz-9RtkFNBiihogMwNUQiF5w at mail dot gmail dot com> <mvmshyqt1jq dot fsf at hawking dot suse dot de> <570E1270 dot 7070606 at redhat dot com>
On 04/13/2016 05:33 AM, Florian Weimer wrote:
> On 04/13/2016 09:23 AM, Andreas Schwab wrote:
>> Either country_num is a plain number, then it should be written as
>> a plain number since the leading zero is ignored, or the leading
>> zero is significant, then it must be encoded as a string to
>> preserve it.
> FWIW, I tend to agree with Andreas here. Maybe a middle-ground would
> be to document somewhere that country_num is always to be formatted
> as a three-digit decimal value.
> (At least POSIX specifies numbers in the locale definition as
> decimal, even with a leading zero. :)
I have access to ISO 3166-1:2013 as part of my responsibilities within
the Standards Council of Canada. I have reviewed the standard language
with regards to this question, and to see if the standard can be improved
to help clarify this point. This meets my obligation to use the standard
in the development of standards.
My opinion is that glibc is failing to meet the standard by omitting the
The country number in ISO 3166-1:2013 is a three-digit numeric code,
not a two-digit numeric code. Any use of a two-digit numeric code is not
conforming. The valid ranges are 000 to 999.
Therefore writing down the three-digit numeric code in the locale is correct.
The bug is in the representation.
Florian's comment that we should document it as a three-digit decimal value
is a good starting point.
There is actually a numerical representation of the alpha-2 code which
could be used as the country number, and it is a proper number. However,
this is just an informative description and non-normative.
- To follow ISO 3166-1:2013 we must preserve all leading 0's, it is a
three-digit numeric code.
- We should probably just document that valid codes must be printed
with leading zeros and be 3 digits long.