RE: [xml] problem with encodings

Hello Sergi,

i've got similar problem using xmlSaveFormatFileTo().
I've found a solution that works for me, although
i don't know if it's the correct way (in terms of
libxml2)to handle these things.
Unfortunately i've no response to my posting that
refers to this, may i should re-post it since i've
send it as RE: to another posting of mine (could
be mistakable).

Anyway, that's what i've done:
Manualy set the encoding of the newly created doc
immediately, before appending any child nodes via

docPtr->encoding = xmlStrdup("iso-8859-1");

Doing so, i'll get the correct encoding in the saved
document, even if i use NULL as encoding-param in

Hope that helps & Ciao, Markus

-----Original Message-----
From: Sergi March [mailto:sergi march millorsoft es]
Sent: Thursday, January 10, 2002 10:19 AM
To: xml gnome org
Subject: [xml] problem with encodings

I am using this function to save an xml file

xmlSaveFormatFileEnc(ficheroSalida, dtd->doc, "ISO-8859-1", 1);

but whatever the encoding I use (ISO-8859-1, UTF-8, 
NULL)...always saves 
this character: Ó as
this one:


what I'm doing wrong? It's something about the entities?

Thanks in advance.


        Sergi March Montón - <sergi millorsoft es>
      Departament d'Internet
        Millor Soft, S.L. Mollerussa - Lleida

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