Python STILL prints the wrong international letters

David LeBlanc whisper at oz.nospamnet
Sat May 19 14:12:44 EDT 2001


In article <92ae279c.0105181619.5326cbde at posting.google.com>, 
machin_john_888 at hotmail.com says...
> David LeBlanc <whisper at oz.nospamnet> wrote in message news:<9e3nda$eb5$k at 216.39.170.247>...
> > It seems reasonable to me that the encoding the GUI is using is not the 
> > same that the console is using - dunno why. In Tcl there are ways to set 
> > the encoding of an incoming stream - is there the like in Python?
> > 
> 
> This is true but *not* reasonable. Windows ("GUI") uses a different
> code page to DOS ("console").

I didn't mean that windows was reasonable - when is it ever? :-)

<snip>

> What I don't know is how to determine what the current codepage is.
> It's not in os.environ ...
> 
> The locale module doesn't seem to be of much help here; it tells me
> 'cp1252' even in a DOS window:
> 
> >>> import locale
> >>> locale.getdefaultlocale()
> ('en_AU', 'cp1252')
> >>>
> 
I get what seems to be an entirely bogus number for the cp on win NT 
4.0sp6a US version on both console and window (idle):
>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'cp28593')



More information about the Python-list mailing list