Some locale data are broken

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Some locale data are broken

Eric van Gyzen-5
Some locale data seem to be broken on stable/11 and head (r308418 and
r308217, respectively).

$ LANG=fr_FR.UTF-8 locale -k thousands_sep
thousands_sep=" "

$ ll /usr/share/locale/fr_FR*/LC_NUMERIC
lrwxr-xr-x  1 root  wheel  29 Nov  2 13:41
/usr/share/locale/fr_FR.ISO8859-1/LC_NUMERIC ->
../uk_UA.ISO8859-5/LC_NUMERIC
lrwxr-xr-x  1 root  wheel  29 Nov  2 13:41
/usr/share/locale/fr_FR.ISO8859-15/LC_NUMERIC ->
../uk_UA.ISO8859-5/LC_NUMERIC
lrwxr-xr-x  1 root  wheel  25 Nov  2 13:41
/usr/share/locale/fr_FR.UTF-8/LC_NUMERIC -> ../uk_UA.UTF-8/LC_NUMERIC

$ cat /usr/share/locale/uk_UA.UTF-8/LC_NUMERIC
,
 
3

I'm not sure what Ukraine uses for a thousands separator, but this is
definitely wrong for France.

Eric

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Some locale data are broken

Jean-Sébastien Pédron
On 17.11.2016 23:33, Eric van Gyzen wrote:

> $ LANG=fr_FR.UTF-8 locale -k thousands_sep
> thousands_sep=" "
>
> lrwxr-xr-x  1 root  wheel  25 Nov  2 13:41
> /usr/share/locale/fr_FR.UTF-8/LC_NUMERIC -> ../uk_UA.UTF-8/LC_NUMERIC
>
> $ cat /usr/share/locale/uk_UA.UTF-8/LC_NUMERIC
> ,
>  
> 3
>
> I'm not sure what Ukraine uses for a thousands separator, but this is
> definitely wrong for France.
Hi!

What do you find broken exactly?

In fr_FR (I don't know for other french-speaking countries), numbers are
formatted like this:
    12 345,67

Where the English equivalent would be:
    12,345.67

Thus, this fr_FR LC_NUMERIC looks correct to me:
    decimal_point=","
    thousands_sep=" "
    grouping=3

What looks incorrect to me is the output of `locale -k` when no keyword
is specified:

    $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k
    ...
    d_fmt="%m/%d/%y"
    ...
    altmon_1="January"
    ...

    $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k d_fmt
    d_fmt="%d.%m.%Y"

    $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k altmon_1
    altmon_1="janvier"

But it's possible this flag isn't meant to work like this, as I just
discovered it with your mail :)

--
Jean-Sébastien Pédron


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Some locale data are broken

Hajimu UMEMOTO
Hi,

>>>>> On Fri, 18 Nov 2016 09:35:01 +0100
>>>>> Jean-S9bastien P9dron <[hidden email]> said:

dumbbell> What looks incorrect to me is the output of `locale -k` when no keyword
dumbbell> is specified:

dumbbell>     $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k
dumbbell>     ...
dumbbell>     d_fmt="%m/%d/%y"
dumbbell>     ...
dumbbell>     altmon_1="January"
dumbbell>     ...

dumbbell>     $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k d_fmt
dumbbell>     d_fmt="%d.%m.%Y"

dumbbell>     $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k altmon_1
dumbbell>     altmon_1="janvier"

How about this patch?

Sincerely,



--
Hajimu UMEMOTO
[hidden email]  [hidden email]
http://www.mahoroba.org/~ume/

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"

locale.c-prt_keywords-setlocale.diff (487 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Some locale data are broken

Jean-Sébastien Pédron
On 18.11.2016 10:03, Hajimu UMEMOTO wrote:
> How about this patch?

It fixes the issue, thank you!

--
Jean-Sébastien Pédron


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Some locale data are broken

Eric van Gyzen-2
In reply to this post by Jean-Sébastien Pédron
On 11/18/2016 02:35, Jean-Sébastien Pédron wrote:

> On 17.11.2016 23:33, Eric van Gyzen wrote:
>> $ LANG=fr_FR.UTF-8 locale -k thousands_sep
>> thousands_sep=" "
>>
>> lrwxr-xr-x  1 root  wheel  25 Nov  2 13:41
>> /usr/share/locale/fr_FR.UTF-8/LC_NUMERIC -> ../uk_UA.UTF-8/LC_NUMERIC
>>
>> $ cat /usr/share/locale/uk_UA.UTF-8/LC_NUMERIC
>> ,
>>  
>> 3
>>
>> I'm not sure what Ukraine uses for a thousands separator, but this is
>> definitely wrong for France.
>
> Hi!
>
> What do you find broken exactly?
>
> In fr_FR (I don't know for other french-speaking countries), numbers are
> formatted like this:
>     12 345,67
>
> Where the English equivalent would be:
>     12,345.67
>
> Thus, this fr_FR LC_NUMERIC looks correct to me:
>     decimal_point=","
>     thousands_sep=" "
>     grouping=3

Oh!  I had thought France used '.' as a thousands separator.  Thanks for
correcting me, Jean-Sébastien.  Now I'm /certain/ that the libc++ unit tests are
wrong, since they think France uses a ','.  :)

Eric
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Some locale data are broken

Jean-Sébastien Pédron-4
On 18.11.2016 15:32, Eric van Gyzen wrote:
> Oh! I had thought France used '.' as a thousands separator. Thanks
> for correcting me, Jean-Sébastien.

FTR, while I was looking for a confirmation I was correct, I found
another rule I never heard about: a space (a narrow non-breaking spaceto
be exact) is used to separate thousands, but only when the number is a
quantity (like "12 345 croissants"). But when the number represents an
index, there should be no separator (like "croissant n°12345").

Languages are full of curious details :)

--
Jean-Sébastien Pédron


signature.asc (817 bytes) Download Attachment