print() and unicode strings (python 3.1)

7stud bbxx789_05ss at
Tue Aug 25 04:42:36 CEST 2009

On Aug 24, 2:41 pm, "Martin v. Löwis" <mar... at> 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

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