UnicodeDecodeError

Discussion in 'Python' started by Ken Seehart, Jul 21, 2007.

  1. Ken Seehart

    Ken Seehart Guest

    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
    Ken Seehart, Jul 21, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ruslan
    Replies:
    1
    Views:
    500
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Sep 7, 2004
  2. Robin Siebler
    Replies:
    4
    Views:
    26,197
    Tim Peters
    Oct 8, 2004
  3. Thomas Thomas

    UnicodeDecodeError

    Thomas Thomas, May 5, 2005, in forum: Python
    Replies:
    2
    Views:
    312
    Michael Spencer
    May 5, 2005
  4. F. GEIGER
    Replies:
    0
    Views:
    1,576
    F. GEIGER
    May 27, 2005
  5. ash

    UnicodeDecodeError

    ash, Nov 30, 2005, in forum: Python
    Replies:
    5
    Views:
    471
Loading...

Share This Page