Converting string with UTF-8 to Unicode?

Alex Martelli aleax at aleax.it
Tue Feb 11 05:33:16 EST 2003


Grumfish wrote:

> If I have a string with UTF-8 encoded chars like "\xe6\x9d\xb1" how
> can I convert it to a unicode string?

>>> unicode("\xe6\x9d\xb1", 'utf-8')
u'\u6771'
>>>


Alex





More information about the Python-list mailing list