UTF-8 to unicode or latin-1 (and yes, I read the FAQ)
michael at stroeder.com
Thu Oct 19 14:46:26 CEST 2006
NoelByron at gmx.net wrote:
> print 'K\xc3\xb6ni'.decode('utf-8')
> and this line raised a UnicodeDecode exception.
Works for me.
Note that 'K\xc3\xb6ni'.decode('utf-8') returns a Unicode object. With
print this is implicitly converted to string. The char set used depends
on your console
Check this out for understanding it:
>>> u = 'K\xc3\xb6ni'.decode('utf-8')
More information about the Python-list