Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > UnicodeDecodeError

Reply
Thread Tools

UnicodeDecodeError

 
 
Ken Seehart
Guest
Posts: n/a
 
      07-21-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(12

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UnicodeDecodeError ash Python 5 12-02-2005 07:33 AM
[pysqlite 2.0.2] UnicodeDecodeError: 'utf8' codec can't decode bytes in position 44-45: invalid data F. GEIGER Python 0 05-27-2005 07:29 PM
UnicodeDecodeError Thomas Thomas Python 2 05-05-2005 02:48 AM
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 10: ordinal not in range(128) Robin Siebler Python 4 10-08-2004 08:03 PM
minidom's setAttribute + UnicodeDecodeError Ruslan Python 1 09-07-2004 08:33 PM



Advertisments