WTF? Printing unicode strings

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


skip at pobox.com 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
'cp1252'
 >>> 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