[Python-Dev] Encodings

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Sat, 8 Jul 2000 23:33:19 +0200

guido wrote:
> I am perhaps to blame for the idea that the character set of 8-bit
> strings in C can be derived in some whay from the locale -- but the
> main reason I brought it up was as a counter-argument to the Latin-1
> fixed default that effbot arged for.

note that this work isn't exactly wasted; the default encoding
mechanisms can (and should) be used to handle unicode args
to system API's like open (etc).

we just have to figure out how to design the internal API's.
cannot be that hard, can it?

> I never dreamed that you could actually find out the name of the
> character set given the locale!

never underestimate the malbot.

(btw, this magic now works on windows too! ;-)

>>> import locale
>>> print locale.getdefaultlocale()
('sv_SE', 'cp1252')=20