print() and unicode strings (python 3.1)

7stud bbxx789_05ss at yahoo.com
Mon Aug 24 22:42:36 EDT 2009


On Aug 24, 2:41 pm, "Martin v. Löwis" <mar... at v.loewis.de> wrote:
> > I can't figure out a way to programatically set the encoding for
> > sys.stdout.  So where does that leave me?
>
> You should be setting the terminal encoding administratively, not
> programmatically.
>

The terminal encoding has always been utf-8.  It was not set
programmatically.

It seems to me that python 3.1's string handling is broken.
Apparently, in python 3.1 I am unable to explicitly set the encoding
of a string and print() it out with the result being human readable
text.  On the other hand, if I let python do the encoding implicitly,
python uses a codec I don't want it to.






More information about the Python-list mailing list