Trouble with unicode

Charlie Clark charlie at begeistert.org
Mon May 14 22:14:19 CEST 2001


I'm having trouble convert the contents of e-mails stored as unicode
files into plain text. I'm not sure if I've understood how to deal with
unicode :-(

As usual the problem is with non-ascii characters.

For example I have the following characters in the mail:
"ä, Ä, ö, Ö, ü, Ü, ß"

when I read the mail in Python as a string I get:
"\xe4, \xc4, \xf6, \xd6, \xfc, \xdc, \xdf"

I've followed the example from
http://www.python.org/2.0/new-python.html
but don't seem to be getting very far and ascii_decode() gives me the
following error:
"UnicodeError: ASCII decoding error: ordinal not in range(128)"

Please help me "get it" with unicode.

Thanx

Charlie Clark



More information about the Python-list mailing list