1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 02:13:56 +09:00

LibTextCodec: Fix ISO-8859-1 vs. windows-1252 handling in web contexts

The Encoding specification maps ISO-8859-1 to windows-1252 and expects
the windows-1252 translation table to be used, which differs from
ISO-8859-1 for 0x80-0x9F.

Other contexts expect to get the actual ISO-8859-1 encoding, with 1-to-1
mapping to U+0000-U+00FF, when requesting it.

`decoder_for_exact_name` is introduced, which skips the mapping from
aliases to the encoding name done by `get_standardized_encoding`.
This commit is contained in:
Simon Wanner 2024-06-02 15:56:36 +02:00 committed by Andreas Kling
parent 46d5cf0443
commit 6b2c459901
Notes: sideshowbarker 2024-07-17 00:49:59 +09:00
7 changed files with 107 additions and 95 deletions

View file

@ -211,6 +211,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ "jis0208"sv, prepare_table(data.get("jis0208"sv)->as_array()) },
{ "jis0212"sv, prepare_table(data.get("jis0212"sv)->as_array()) },
{ "euc_kr"sv, prepare_table(data.get("euc-kr"sv)->as_array()) },
{ "windows_1252"sv, prepare_table(data.get("windows-1252"sv)->as_array()) },
},
};