Skip to main content

parse_bytes

Function parse_bytes 

Source
pub fn parse_bytes(source: &[u8], mode: Mode) -> Document
Expand description

Invalid UTF-8 is replaced before parsing; offsets refer to the repaired text. The size limit measures the raw input bytes, before repair. Each maximal invalid subsequence (one to three bytes) becomes one three-byte U+FFFD, so repaired text is never shorter than the input and may be longer than the limit; an input within the limit is never refused for it.