This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] localedata: CLDRv29: update LC_ADDRESS.country_num values


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
leading zero.

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.

In summary
- 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.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]