Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unicode error message
#1
i got this error message:

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-9: illegal Unicode character

what does the part bytes in position 0-9 refer to?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
It's the index illegal characters in your byte object, that can't be decoded with Unicode-escape.

https://docs.python.org/3/library/except...icodeError

Quote:start
The first index of invalid data in object.

end
The index after the last invalid data in object.
Reply
#3
i found the problem. the code exceeded 0x010ffff (1114111) and thus was not valid unicode and so it could not be encoded into utf-8.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Runtime error: coercing to Unicode: need string or buffer, NoneType found satheesh_rvs 2 2,955 Dec-10-2018, 12:46 PM
Last Post: satheesh_rvs

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020