Skip to main content

find_illegal

Function find_illegal 

Source
pub fn find_illegal(s: &str) -> Option<(usize, char)>
Expand description

The first character of s that XML 1.0 cannot represent, with its byte offset.

Hot path, so a byte pre-scan comes first: every illegal character is a C0 control other than tab, LF and CR, or U+FFFE/U+FFFF (UTF-8 EF BF ..).