Re: [xml] encoding question



Hello,

And is there a way to specify to libxml that all strings I insert should be in some encoding, so I don´t need to do it manually? For example, I say to libxml that and node I insert should be converted from latin1 to utf8, automatically... But what I don´t understand is: I parsed a latin1 xml. So, libxml parser (version 2.6.9) converted all node contents to utf-8, right? So I have a utf-8 xml on memory... But when I dump the xml to a file whitout specifying encoding, it dumps using latin1... and when I add the root node of this tree as a child of a second tree created by hand and I try to dump as latin1, libxml gives me an error saying there are latin1 caracters and those cannot be converted. So, it doesn´t appear libxml is storing the content of a parsed latin1 xml file in UTF-8... I will check it tomorow and examine better my source code. I will take a look to xml source code too. In the case I nee to send some patch, how should I proceed? I am using a stable version of libxml and I will need to run it on a Solaris... Do you know if cvs version is working on Solaris?

Thank you very much,

Marcelo.

Kaarle Kaila wrote:

All data in the memory structures in libxml are in UTF-8 encoding. The
encoding
is used when reading data but is lost after that. You can specify what
encoding
to use when serializing the structure again.

So if I understand your question and libxml right you cannot do what you
want to do.
I think the same goes for the other xml-software packages too.

regards
Kaarle




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