LibTextCodec: Implement gb18030 and gbk encoders

Implements the `gb18030` and `gbk` encoders, as specified by
https://encoding.spec.whatwg.org/#gb18030-encoder
https://encoding.spec.whatwg.org/#gbk-encoder
This commit is contained in:
BenJilks 2024-08-05 21:14:51 +01:00 committed by Tim Ledbetter
parent 34c8c559c1
commit d80575a410
Notes: github-actions[bot] 2024-08-08 16:51:17 +00:00
4 changed files with 152 additions and 1 deletions

View file

@ -240,7 +240,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto json_data = TRY(json_file->read_until_eof());
auto data = TRY(JsonValue::from_string(json_data)).as_object();
auto gb18030_table = prepare_table(data.get("gb18030"sv)->as_array(), GenerateAccessor::Yes);
auto gb18030_table = prepare_table(data.get("gb18030"sv)->as_array(), GenerateAccessor::Yes, GenerateInverseAccessor::Yes);
// FIXME: Encoding specification is not updated to GB-18030-2022 yet (https://github.com/whatwg/encoding/issues/312)
// NOTE: See https://commits.webkit.org/264918@main