WTF? Printing unicode strings

John Salerno johnjsal at
Fri May 19 19:29:24 CEST 2006

skip at wrote:
>     Robert> Because sys.stdout.encoding isn't determined by your Python
>     Robert> configuration, but your terminal's.
> Learn something every day.  I take it "646" is an alias for "ascii" (or vice
> versa)?

Hmm, not that this helps me any :)

 >>> import sys
 >>> sys.stdout.encoding
 >>> import codecs
 >>> codecs.lookup('cp1252')
(<bound method Codec.encode of <encodings.cp1252.Codec instance at 
0x009D6670>>, <bound method Codec.decode of <encodings.cp1252.Codec 
instance at 0x009D6698>>, <class encodings.cp1252.StreamReader at 
0x009CF360>, <class encodings.cp1252.StreamWriter at 0x009CF330>)

More information about the Python-list mailing list