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.
13 lines
322 B
HTML
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(() => {
|
|
let p = document.getElementById("p");
|
|
println(p.textContent);
|
|
println(p.getAttribute("data-中文"));
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|