[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"?>
<doc>K&#xE4;se</doc>

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

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

Nick


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