ordinal not in range(128)

Ralf Claus ralf.claus_spam_ at t-online.de
Sat May 12 15:04:46 CEST 2001


I could answer the question. But  i do not point why it functioned.
Normally, this is the way to capture text from a TextWidget.
(I type äöüäöü in the TextWidget)

text = self.c.get(1.0,END)
print text

Traceback (most recent call last):
  File "e:\python20\lib\lib-tk\Tkinter.py", line 1287, in __call__
    return apply(self.func, args)
  File "I:\EXAMPLE\ascii.py", line 16, in druck
    print text
UnicodeError: ASCII encoding error: ordinal not in range(128)

This way functioned:
text = string.join(map(chr,map(ord,self.c.get(1.0,END))),'')
print text
äöüäöü

What happens here exactly?


"Ralf Claus" <ralf.claus at teleatlas.com> schrieb im Newsbeitrag
news:3AFBA4BA.B0DDD7B4 at teleatlas.com...
> Hello,
> can you tell me something about this error ?
> With py 1.5.2 and Tcl/Tk 8.05 there are no problems!
> With py 2.0 and Tcl/Tk 8.3 this error occurs if i try to
> work with german "Umlaute" >äöü< in a Text Widget.
> To type s='ö' in the idle is not possible.
> How can i solve this problem ?
>
> Gruß
> Ralf





More information about the Python-list mailing list