script: Use chardetng to guess encoding when all else fails (#41435)

[`chardetng`](https://github.com/hsivonen/chardetng) is the library used
by gecko to guess encodings.

This makes https://intsys.co.jp/game/panepon/p01/index.html load with
the correct encoding. Notably, that site uses shift-jis but has no
encoding declaration of any kind.

Part of https://github.com/servo/servo/issues/6414

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker
2025-12-21 09:53:42 +01:00
committed by GitHub
parent 6964956110
commit a58d9727f9
10 changed files with 66 additions and 13 deletions

View File

@@ -0,0 +1,6 @@
[utf-32.html]
[Expect resources/utf-32-big-endian-bom.html to parse as UTF-8]
expected: FAIL
[Expect resources/utf-32-big-endian-bom.xml to parse as UTF-8]
expected: FAIL