I get the following line from one site using mechanization:
'We\x92ve'
I know that \ x92 stands for the character . I am trying to convert this string to Unicode:
>> unicode('We\x92ve','utf-8') UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 2: unexpected code byte
What am I doing wrong?
Edit: the reason I tried to use "utf-8" was:
>> response = browser.response() >> response.info()['content-type'] 'text/html; charset=utf-8'
Now I see that I can not always trust the content header.
source share