I got this very very frustrating error when inserting a certain string into my database. It said something like:
Python cannot decode byte characters, expecting unicode"
After a lot of searching, I saw that I could overcome this error by encoding my string into Unicode. I try to do this by decoding the string first and then encoding it in UTF-8 format. Like:
string = string.encode("utf8")
And I get the following error:
'ascii' codec can't decode byte 0xe3 in position 6: ordinal not in range(128)
I have been dying with this error! How do I fix it?