print and unicode strings
Jason Orendorff
jason at jorendorff.com
Wed Feb 20 21:47:31 EST 2002
Martin v. Loewis wrote:
> "Jason Orendorff" <jason at jorendorff.com> writes:
>
> > I think IDLE should do this by default. It's fine for
> > Python to "refuse to guess" encodings, but in the case of Tk
> > it's UTF-8 on all platforms... right?
>
> Well, not exactly. Tkinter supports Unicode strings as primary data
> type for text, with byte strings (e.g. UTF-8) only being the second
> choice. So IDLE should set sys.stdout to a stream that accepts Unicode
> objects as-is.
Thank you for the hint. I've submitted the patch (a one-liner):
http://sourceforge.net/tracker/index.php?func=detail&aid=520483&group_id=547
0&atid=305470
> Also, setting the stream for the console to cp437 is not ideal; it
> would be much better if Python would use the Unicode console API
> (i.e. WriteConsoleW) if it detects that sys.stdout is a console. If
> you then use the Lucida Console font (instead of the raster font), you
> might be even able to display COMET in a console.
That sounds nice. I'll try to implement this next.
## Jason Orendorff http://www.jorendorff.com/
More information about the Python-list
mailing list