string encoding problem

Rodolphe robloche at fr.st
Wed Nov 20 17:34:20 EST 2002


Hi everybody,

I've got the very short code :

### begin

import tkSimpleDialog
str = tkSimpleDialog.askstring('Bug','Say something...')
print str

### end

And when I run it and enter a string containing accented characters (like 
"fenêtre"), I've got this :

Traceback (most recent call last):
  File "D:\Programmes\Python\Cut off\bug.py", line 4, in ?
    print str
UnicodeError: ASCII encoding error: ordinal not in range(128)


Of course, if I enter a "regular" string like "foo bar", the string is 
printed on the screen without raising an error.


Could someone help me out with this simple problem ?


--
Rodolphe



More information about the Python-list mailing list