Treat trailing UTF-8 prefixes with an invalid second byte as complete input for streaming decode, so replacement characters are emitted in the current chunk instead of being held until later input or finish. Keep valid incomplete prefixes buffered across chunk boundaries. Keep TextDecoderStream from holding continuation bytes after an invalid lead byte at a chunk boundary. Add LibTextCodec and TextDecoderStream coverage for invalid tails, valid split sequences, EOF partials, surrogate sequences, and malformed continuation tails.
17 lines
762 B
Text
17 lines
762 B
Text
invalid_second_byte_e0_80: [2, fffd, fffd]
|
|
invalid_second_byte_f4_90: [2, fffd, fffd]
|
|
split_valid_2_byte: [1, e9]
|
|
split_valid_3_byte: [1, 800]
|
|
split_valid_4_byte: [2, 10000]
|
|
eof_incomplete_2_byte: [1, fffd]
|
|
eof_incomplete_3_byte: [1, fffd]
|
|
eof_incomplete_4_byte: [1, fffd]
|
|
ascii_prefix_then_eof_incomplete_3_byte: [1, 78] | [1, fffd]
|
|
incomplete_prefix_then_ascii: [2, fffd, 78]
|
|
complete_sequence_with_extra_continuation: [2, e9, fffd]
|
|
surrogate_sequence: [3, fffd, fffd, fffd]
|
|
invalid_lead_f5_with_continuations: [4, fffd, fffd, fffd, fffd]
|
|
overlong_c0_with_continuations: [3, fffd, fffd, fffd]
|
|
continuation_only_tail: [4, fffd, fffd, fffd, fffd]
|
|
invalid_lead_then_ascii: [2, fffd, 78]
|
|
invalid_lead_with_continuations_then_ascii: [5, fffd, fffd, fffd, fffd, 78]
|