[lxml-dev] UTF-8 not supported

Ovnicraft ovnicraft at gmail.com
Mon May 25 11:23:46 CDT 2009


2009/5/25 Ovnicraft <ovnicraft at gmail.com>

>
>
> 2009/5/25 Alexander Shigin <shigin at rambler-co.ru>
>
> В Пнд, 25/05/2009 в 10:54 -0500, Ovnicraft пишет:
>> > Hi folks, when do this, encoding='iso-8859-1' write xml enconding ok,
>> > but when try the same thing with 'UTF-8', not appears in my file, i
>> > have 2.2 version.
>> > How i can encoding my file with utf-8?
>>
>> Can you give your code snippet? UTF-8 works fine for me.
>>
>> Here is an example:
>> In [6]: print etree.tostring(etree.Element(unicode('ыъъ', 'utf-8')),
>> encoding='utf-8')
>> <ыъъ/>
>>
>> If you haven't got cyrillic letters:
>> In [9]: etree.tostring(etree.Element(u'\u044b\u044a\u044a'),
>> encoding='utf-8')
>> Out[9]: '<\xd1\x8b\xd1\x8a\xd1\x8a/>'
>>
>>
>>
>>
> I write something very simple, http://lxml.pastebin.com/m3f8c5b9c


With utf-8, http://lxml.pastebin.com/m72a14d.

>
>
>
>
> --
> Cristian Salamea
> CEO GnuThink Software Labs
> Software Libre / Open Source
> (+593-8) 4-36-44-48
>



-- 
Cristian Salamea
CEO GnuThink Software Labs
Software Libre / Open Source
(+593-8) 4-36-44-48
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail5.webfaction.com/pipermail/lxml/attachments/20090525/e353e9e9/attachment.html 


More information about the lxml mailing list