Bug#209402: locales: Setting LC_CTYPE to ISO-8859-1 does not work
On Tue, Sep 09, 2003 at 11:07:38PM +0200, Daniel Bonniot wrote:
> Colin Watson wrote:
> >Try 'LC_CTYPE=fr_FR.ISO-8859-1' instead. You need the language and
> >country parts there.
>
> That works. However I wonder: why do I need to specifiy a language and
> country? ISO-8859-1 is ISO-8859-1, independently of any specific
> country, after all.
The LC_CTYPE variable sets the character classification and case
conversion rules. Picking an encoding is just one part of this: things
like case conversion rules vary considerably between languages and
probably even variants of languages, and there isn't a reasonable way
for the C library to guess which one you meant.
> BTW, is this specified somewhere? POSIX?
POSIX leaves locale names up to the implementation, with the exception
of the predefined locales C and POSIX. For the gory details, see:
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap07.html
http://www.opengroup.org/onlinepubs/007904975/functions/setlocale.html
The latter does happen to give fr_FR.ISO-8859-1 as an example, though.
Cheers,
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: