[xml] Serialization of documents without encoding

libxml2 serializes documents without an encoding declaration differently than documents with an explicit UTF-8 encoding:

$ echo '<?xml version="1.0"?><doc>Käse</doc>' |xmllint -
<?xml version="1.0"?>

$ echo '<?xml version="1.0" encoding="utf-8"?><doc>Käse</doc>' |xmllint -
<?xml version="1.0" encoding="utf-8"?>

Since the encoding should default to UTF-8, can anyone explain why this decision was made?


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