Umlaut and Tkinter

Kevin Russell prairiesasquatch at crosswinds.net
Thu Mar 15 22:13:34 EST 2001


Michael Husmann wrote:

> typing in idle.py using Python 2.1b1:
>
> >>> print "ÄÖ"
>
> results in an:
>
> UnicodeError: ASCII encoding error: ordinal not in
> range(128)
>
> Is there someone who can help me.
>
> Michael

This looks like a messy incompatibility between Python 2's
not-quite-fully-integrated-yet Unicode support and Tcl's
even-less-quite-fully-integrated-yet Unicode support, and the
desire of one or both of the parties to communicate in the
lowest common denominator (ASCII) unless beaten over the head
with a stick and forced not to.

Until the Tkinter and Unicode gurus can sort the mess out,
in their abundant free time, you'll probably have to use
one of the other Python interfaces if you want to be able to
use upper-128 Latin-1 characters at an interactive prompt.
I just tried your '''print "ÄÖ"''' line in both PythonWin
and the Python mode of Emacs (with Python 2.0) and it does
what you'd expect.  It also works fine under in a Windows
MS-DOS box (abstracting away from the whole different passel
of character set problems there), so I suspect it should
also work OK at a Unix command line.

Good luck.

-- Kevin







More information about the Python-list mailing list