[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: locale name standard



At 19 Jun 2001 17:38:14 +0200,
Robert Bihlmeyer wrote:
> libc example (only works when the locale is present, see
> /etc/locale.gen):
> 
> $ for LANG in de de_DE de_DE.foo de_DE.ASCII de_de.iso-8859-1 de_DE.iso-8859-1 de_DE.ISO-8859-1 de_DE.ISO8859-1 de_DE.ISO-88591 de_DE.ISO88591; do printf "%-20s " $LANG; date +"%A"; done 
> de                   Tuesday

Because there is no region identifier (yy of xx_yy.zz)
when you compiled using localedef(1).

> de_DE                Dienstag
> de_DE.foo            Tuesday

.foo is not registered as appropriate locale name.

> de_DE.ASCII          Tuesday

ASCII is not ISO-8859-1. You cannot use any ISO-8859-1 characters 
except for ASCII characters. `de_DE' locale should support ISO-8859-1,
but ASCII supports narrow range of characters compared with ISO-8859-1.

> de_de.iso-8859-1     Tuesday

Wrong. 2nd part of locale name, region identifier must set as capital letter.

> de_DE.iso-8859-1     Dienstag
> de_DE.ISO-8859-1     Dienstag
> de_DE.ISO8859-1      Dienstag
> de_DE.ISO-88591      Tuesday

Because ISO-88591 is not registered in current glibc's conversion table.

> Wow, so for strftime to work correctly, language and territory have to
> be there (case is significant); charset must be absent or known, where
> case is irrelevant this time, some dashes may be omitted, but not
> every time. Eeek.

Yes. Because you set wrong locale designation.

> It gets hairier with libX11. Let's use a gtk program because they
> issue nice warnings when X11 did not recognize the locale.
> From the above variants, only
> de_DE
> de_DE.ISO8859-1
> succeed without warning, meaning they are recognized by glibc /and/
> xlib. The others give the warning, and problems with latin1 characters
> (see bug#100970).

That's right. 

> OTOH, glibc seems to suggest that "de_DE.ISO-8859-1" is the standard
> value, see /etc/locale.alias. "locale -a" reports deutsch, german,
> de_DE, de_DE@euro. None of these are standard according to xlib.

glibc's `standard name' is not world standard name.
It's only glibc's internal locale/codeset presentation name.

Try the latest glibc. The latest glibc have the support
de_DE.ISO8859-1 as the `code conversion alias name'.
You see /usr/lib/gconv/gconv-modules then find conversion alias name.

> Rather than populating /usr/X11R6/lib/X11/locale/locale.alias with a
> gazillion alternatives as suggested in bugs 84735, 86903, and 99350,
> why not standardize on one format and *document* that?

There is no formal standard, because many people use
many dialects over the world...!
IANA registration of the codeset is good reference, IMHO.

-- gotom



Reply to: