Re: Serialization of documents without encoding
Nick Wellnhofer <[email protected]> Tue, 25 Sep 2018 14:36:03 +0200
| Newsgroups | gmane.comp.gnome.lib.xml.general |
|---|---|
| Message-ID | <[email protected]> |
On 25/09/2018 13:19, Nick Wellnhofer wrote: > libxml2 serializes documents without an encoding declaration differently than > documents with an explicit UTF-8 encoding: It seems that this was partially changed in 2005 with the following commit: https://gitlab.gnome.org/GNOME/libxml2/commit/64354ea7d6b8e0d95f3f9bcfdc98bddd065b65fc But this change only applies to text nodes, not attribute content. It also only applies when serializing with xmlNodeDumpOutput or xmlNodeDump, not when using the xmlSave API (which xmllint uses). The whole situation is a mess. I'd love to change the code so that non-ASCII chars are always encoded as UTF-8, but I'm scared to break things. Nick