pub fn is_interchange_invalid(c: char) -> boolExpand description
Checks if a character is “interchange-invalid” according to Unicode and HTML preprocessing specs.
This function identifies codepoints that can trigger parser inconsistencies or upstream bugs:
- C0 control characters: ASCII values
0x00..=0x1Fexcept allowed whitespace:- Horizontal Tab (
0x09) - Line Feed (
0x0A) - Form Feed (
0x0C) - Carriage Return (
0x0D)
- Horizontal Tab (
- C1 controls and DEL:
0x7F..=0x9F - Unicode Non-characters:
- Range
U+FDD0..=U+FDEF(32 codepoints) - Plane non-characters ending in
0xFFFEor0xFFFF(e.g.,U+FFFE,U+FFFF,U+10FFFF)
- Range
By identifying these characters early, the library ensures that no malformed unicode reaches client-side rendering engines.