Re: [xml] Serialization of documents without encoding

2018-11-15 Thread Daniel Veillard via xml
On Thu, Sep 27, 2018 at 02:22:55PM +0200, Nick Wellnhofer wrote: > On 27/09/2018 10:59, Roumen Petrov wrote: > > Let consider case as "file" mode. > > > Let consider case as "stream" code. > > I'm not only talking about xmllint but the serialization API (xmlSave*, > xmlNodeDump*) in general. >

Re: [xml] Serialization of documents without encoding

2018-11-15 Thread Daniel Veillard via xml
On Tue, Sep 25, 2018 at 01:19:51PM +0200, Nick Wellnhofer wrote: > libxml2 serializes documents without an encoding declaration differently > than documents with an explicit UTF-8 encoding: > > $ echo 'Käse' |xmllint - > > Kse > > $ echo 'Käse' |xmllint - > > Käse > > Since the encoding

Re: [xml] Serialization of documents without encoding

2018-11-15 Thread Daniel Veillard via xml
Sorry I ddin't watch my xml folder for a while ... a bit busy On Sat, Oct 06, 2018 at 07:32:00PM +0300, Roumen Petrov wrote: > Hi Nick, > > Nick Wellnhofer wrote: > > On 25/09/2018 14:36, Nick Wellnhofer wrote: > > > The whole situation is a mess. I'd love to change the code so that > > >

Re: [xml] Serialization of documents without encoding

2018-10-06 Thread Roumen Petrov
Hi Nick, Nick Wellnhofer wrote: On 25/09/2018 14:36, Nick Wellnhofer wrote: 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. Long time ago I did some test with html -

Re: [xml] Serialization of documents without encoding

2018-09-27 Thread Nick Wellnhofer
On 25/09/2018 14:36, Nick Wellnhofer wrote: 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. This is the change I have in mind:

Re: [xml] Serialization of documents without encoding

2018-09-27 Thread Nick Wellnhofer
On 27/09/2018 10:59, Roumen Petrov wrote: Let consider case as "file" mode. Let consider case as "stream" code. I'm not only talking about xmllint but the serialization API (xmlSave*, xmlNodeDump*) in general. Now about above test samples . if content is stored in file xmllint works fine

Re: [xml] Serialization of documents without encoding

2018-09-27 Thread Roumen Petrov
Hi Nick, Hi, Nick Wellnhofer wrote: libxml2 serializes documents without an encoding declaration differently than documents with an explicit UTF-8 encoding: $ echo 'Käse' |xmllint - Kse $ echo 'Käse' |xmllint - Käse Since the encoding should default to UTF-8, can anyone explain why this

Re: [xml] Serialization of documents without encoding

2018-09-25 Thread Nick Wellnhofer
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:

[xml] Serialization of documents without encoding

2018-09-25 Thread Nick Wellnhofer
libxml2 serializes documents without an encoding declaration differently than documents with an explicit UTF-8 encoding: $ echo 'Käse' |xmllint - Kse $ echo 'Käse' |xmllint - Käse Since the encoding should default to UTF-8, can anyone explain why this decision was made? Nick