1 pub const TEXT_FLOW_CONTROL_CHARS: &[char] = &[
2 '\u{202A}', '\u{202B}', '\u{202D}', '\u{202E}', '\u{2066}', '\u{2067}', '\u{2068}', '\u{202C}',
7 pub fn contains_text_flow_control_chars(s: &str) -> bool {
18 let mut bytes = s.as_bytes();
20 match core::slice::memchr::memchr(0xE2, &bytes) {
22 // bytes are valid UTF-8 -> E2 must be followed by two bytes
23 let ch = &bytes[idx..idx + 3];
25 [_, 0x80, 0xAA..=0xAE] | [_, 0x81, 0xA6..=0xA9] => break true,
28 bytes = &bytes[idx + 3..];