Files
ladybird/Libraries/LibTextCodec/Encoder.cpp
Martin Chrástek 9267d2d408 LibTextCodec: Fix ISO-2022-JP encoder escape seq on unencodable error
When the encoder encounters an unencodable code point while in jis0208
state, the spec says to emit ESC ( B (0x1B 0x28 0x42) to switch to
ASCII mode before returning an error. The encoder was incorrectly
emitting ESC ( J (0x1B 0x28 0x4A) which selects Roman mode instead.

This caused form submission using ISO-2022-JP to produce incorrect
escape sequences when replacing unencodable characters with numeric
character references.

Also imports the WPT iso2022jp-encode-form-errors-stateful test.
2026-05-07 17:46:31 +02:00

25 KiB