Re: [xml] xmlSaveToFilename with UTF-8 encoding

On Thu, Apr 19, 2007 at 08:42:19PM +0200, Michael Rottmeier wrote:
Hi Martin and Daniel,

[quote from Martin's reply]

Does this problem occur always for you, even with the example files?
What encoding is written into the xml header?

I haven't tried the example files yet but will do this.

The original XML file has a UTF-8 header and is properly encoded in UTF-8 (if you look at it with an hex 
viewer) with a UTF-8 BOM sequence.
The same goes for the XSL file; the "xsl:output encoding" is set to UTF-8.

  You did not provide said files. No way I can check, and I hate guessing...

Maybe I should add that I'm working on Windows and use the Delphi/Pascal version of libxml2.

  I have no idea what the Delphi/Pascal bindings do.

BTW: another question but related to this topic
Is there any way to force a "Save data to file" - function/procedure to add a UTF-8 BOM sequence to be 
added at the beginning of the file?

  UTF-8 BOM is completely redondant for an XML parser if not even broken,
It is more likely to generate interoperability problems than anything else.
Do not do this
even if it's legal (second paragraph)


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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