UTF-8 / German, Scandinavian letters - is it really this difficult?? Linux & Windows XP

Duncan Booth duncan.booth at invalid.invalid
Tue Feb 22 09:29:37 EST 2005


Max M wrote:

> And this string will automatically be utf-8 encoded:
> 
> st = 'æøå'
> 
> So you should be able to convert it to unicode without giving an
> encoding: 
> 
> ust = unicode(st)
> 
No.

Strings have no knowledge of their encoding. As you describe the string 
will be utf-8 encoded, but you still have to tell it that when you decode 
it.



More information about the Python-list mailing list