ladybird/Tests/LibWeb/Text/input/XHTML/non-ascii-utf8-encoding.xhtml
Tim Ledbetter f607af9ff3 LibWeb: Use XML encoding rules for XML document loading
Previously, the XML document loading paths used the HTML encoding
sniffing algorithm to determine character encoding. After the chardetng
integration, this algorithm could return a non-UTF-8 encoding for XML
documents that did not specify a charset, causing non-ASCII UTF-8
content to be decoded incorrectly.

We now use BOM sniffing and default to UTF-8, per the XML specification.
2026-05-24 00:51:14 +02:00

13 lines
322 B
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p id="p" data-中文="日本語">café</p>
<script src="../include.js"></script>
<script>
test(() =&gt; {
let p = document.getElementById("p");
println(p.textContent);
println(p.getAttribute("data-中文"));
});
</script>
</body>
</html>