[Zope] UnicodeDecodeError

Dieter Maurer dieter at handshake.de
Mon Aug 14 13:12:50 EDT 2006


Luiz Fernando Bernardes Ribeiro wrote at 2006-8-14 11:03 -0300:
>Due to project demands I had to convert the html entities in all TEXT fields
>in my database to the real international characters like "á", "ç" and so on.

Good!

>The problem is that all my dynamic generated XML started to fail with
>UnicodeDecodeError. The XML encoding is set to utf-8 and the file itself is
>correctly encoded.
>
>If I inject the international characters using a Python Script with
>something like u'çáé' it works, but passing the TEXT field from the database
>generates the error.

Then, this means that the value from the database is not unicode.

Convert it to unicode by "value.decode(the_database_encoding)".



-- 
Dieter


More information about the Zope mailing list