Re: [xml] python, xml, utf8->iso-8859-2 problem



On Tue, Feb 18, 2003 at 09:17:50AM +0100, Pavel Stehule wrote:
On Mon, 17 Feb 2003, Daniel Veillard wrote:

On Mon, Feb 17, 2003 at 08:09:09PM +0100, Pavel Stehule wrote:
element.newChild(None,"beta","¾lutý kùò")


This string is in iso-8859-2 encoding. Conversion iso-8859-2 (latin2) to 
utf8 is ok. I have problem with latin2->utf->latin2 conversion. In 
documentation you write, so I can use iconv. What is mean? And so can I 
use own conversion handler? But I didn't find any documentation about it 
on internet. I have problem only with serialisation.

  You must use UTF8 encoded string for all tree operations. The way you
generate those strings is not libxml2 matter.

in my sitecusyomize.py I have

encoding="iso-8859-2"
sys.setdefaultencoding(encoding)

  This doesn't change anything. Libxml2 operations are defined on 
terms of UTF8 strings only, independantly of those settings.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]