convert strings to utf-8

John Nagle nagle at animats.com
Sun Feb 25 20:30:13 EST 2007


Diez B. Roggisch wrote:
> Niclas schrieb:
> 
>> Thank you!
>>
>> solved it with this:
>>  unicode( data.decode('latin_1') )
> 
> 
> The unicode around this is superfluous.

    Worse, it's an error.  utf-8 needs to go into a stream
of 8-bit bytes, not a Unicode string.

				John Nagle



More information about the Python-list mailing list