Double decoding of strings??

Peter Otten __peter__ at web.de
Mon Dec 5 08:01:33 EST 2005


manuzhai at gmail.com wrote:

> Ultimately, I think the solution will be to .decode('utf-8') a string
> twice 

Try

>>>
"Altru\xc3\x83\xc2\xafsme".decode("utf8").encode("latin1").decode("utf8")
u'Altru\xefsme'
>>> print _
Altruïsme

Peter




More information about the Python-list mailing list