This is the mail archive of the
libc-alpha@sourceware.org
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: Andreas Schwab <schwab at suse dot de>, 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 14:13:30 -0400
- Subject: Re: [PATCH v2] localedata: CLDRv29: update LC_ADDRESS.country_num values
- Authentication-results: sourceware.org; auth=none
- References: <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> <20160413143827 dot GG6588 at vapier dot lan> <mvmbn5dr0yt dot fsf at hawking dot suse dot de> <20160413173820 dot GL6588 at vapier dot lan>
On 04/13/2016 01:38 PM, Mike Frysinger wrote:
> On 13 Apr 2016 17:18, Andreas Schwab wrote:
>> Mike Frysinger <vapier@gentoo.org> writes:
>>> On 13 Apr 2016 09:23, 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.
>>>
>>> it isn't a string, it's a decimal number. the code enforces it.
>>> the leading zero is insignificant here once it's been encoded which
>>> leaves it as a style choice in the source locales. since the files
>>> are meant to match the standards, using the style of the standards
>>> makes sense.
>>
>> Just because the standard is confusing doesn't mean we have to follow
>> it.
>
> i don't find the standard confusing at all. what i do find confusing is
> looking at the standard and all the downstream data stores (including,
> but not limited to, CLDR) use zero-padded 3 digits. except glibc. so
> then i have to spend time figuring out which is correct only to realize
> later that they're both correct in practice -- glibc internally stores
> the value as an integer, so leading zeros don't matter. by keeping the
> locale files matching the standards, things are clear for people.
Agreed. The locale files should match the standard, as I noted up-stream
the standard is actually "a three-digit numeric code" and the leading zeros
are important in that definition that it be three-digits. If you were to
write a parser for the numeric codes you could write one that always assumes
there are three digits and you would be right.
--
Cheers,
Carlos.