UnicodeDecodeError

Ken Seehart ken at seehart.com
Sat Jul 21 16:46:20 EDT 2007


I get this whenever I encounter a non-ascii character in a non-unicode 
string:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 23: 
ordinal not in range(128)

The string in question is "... ESPA\xd1OL ..."

I completely understand why I get the error, and my solution will be to 
simply convert to unicode (since the code that uses the string is 
unicode ready).

I am wondering if anyone knows where I can find a mapping from this 
particular extended ascii code (where \xd1 is Ñ), to the corresponding 
unicode characters.

Ken





More information about the Python-list mailing list