I have hebrew data such that \xe0 is the hebrew aleph,
and wish to convert it into utf-8
I have hebrew data such that \xe0 is the hebrew aleph, and wish to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In general in Python, if you have a byte string you need to use decode first to convert it to the internal representation, afterwards you can encode it to UTF-8. Of course, you need to know the coding of
\xe0for this to work (I assume your character is encoded using ISO-8859-8):EDIT:
A side note:
Make sure to use the internal representation in your program as long as possible. In general: decode first (on input), encode last (on output).