Problems when converting from QString to str

teo teo at
Wed Jul 25 06:36:49 EDT 2001

if i try to convert a Qstring (Qt 2.3.3) containing 'å'-'ä' or 'ö' to
python str i get the following error:

self.Comment contains u'testing å ä ö' 


comment_text = str(self.Comment.text())

File "", line 469, in slotOK
comment_text = str(self.Comment.text())
File "/usr/local/lib/python2.1/site-packages/", line 965, in
return str(self.sipThis)
UnicodeError: ASCII encoding error: ordinal not in range(128)

Does this mean I actually can't handle 'åäö' in my application or is
my code wierd?

More information about the Python-list mailing list