[PyKDE] Problem with German characters

Detlev Offenbach detlev at die-offenbachs.de
Tue Oct 15 19:44:01 BST 2002


Am Dienstag, 15. Oktober 2002 19:37 schrieb jblazi:
> I have a QTextEdit widget and read the text:
>
> text = str(texedit.text())
>
> If the text contains an 'ö', that is o umlaut, I get the error message
>
> UnicodeError: ASCII encoding error: ordinal not in range(128)
>
> How can I solve this problem?
>
> TIA,

Use unicode instead of str and it works ok.

text = unicode(textedit.text())

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de




More information about the PyQt mailing list