[lxml-dev] lxml with utf-8

Stefan Behnel stefan_ml at behnel.de
Wed Jun 18 16:46:58 CEST 2008


Daniel Jirku wrote:
> My script looks like this...
>
>     # -*- coding: utf-8 -*-
>     ....
>     badString = "blöm"

Make that

      badString = u"blöm"

Mind the 'u', which makes it a unicode string. Your code above gives you a
UTF-8 encoded byte string.

Stefan



More information about the lxml-dev mailing list