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 - Käse $ 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-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 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: https://github.com/nwellnhof/libxml2/commit/53551ec2f6a2ef03bfcfb6d73b6