unknown locale de_DE at euro
vincent wehren
vincent at visualtrans.de
Sun May 12 11:34:53 EDT 2002
Martin v. Löwis wrote:
> "vincent wehren" <v.wehren at home.nl> writes:
>
>> The locale de_DE at euro (which I uses ISO-8859-15 as encoding), as used by
>> e.g. SuSe 8.0 Linux,is not (yet) regognized by the locale module of
>> Python2.2. A ValueError is raised when calling the module's
>> "getdefaultlocale()" method. How can one go about handling this? Should
>> one add it to the encoding aliases in locale.py? Any suggestions?
>
> I recommend to either ignore or fix locale.getdefaultlocale; as is, it
> is utterly broken.
>
> Why do you need it? If you want to obtain the locale's charset, use
> locale.nl_langinfo(locale.CODESET) (after performing setlocale).
>
> HTH,
> Martin
Since I started off using Python on a win32 environment, locale_langinfo()
had never been an option; true, on linux this'll work; Ofcourse, on Windows
it won't. (ofcourse, de_DE at euro will hardly pop up on a Windows machine)
Still, to be able to use one method on both OS's, wouldn't it be ok to add
something likr
elif '@' in code:
return code.split('@').[0]
to _parse_localename() or add 'de_de at euro': 'de_DE.ISO-8859-15' to
locale_alias engine in locale.py....?
Regards
Vincent Wehren
More information about the Python-list
mailing list