Skip to main content

decode_xml_to_utf8_bytes

Function decode_xml_to_utf8_bytes 

Source
pub fn decode_xml_to_utf8_bytes(bytes: Vec<u8>) -> SchemaResult<Vec<u8>>
Expand description

Decode raw XML bytes into UTF-8 bytes, sniffing common Unicode encodings per XML 1.0 §F.1.

Recognizes UTF-8 with/without BOM and UTF-16 LE/BE with/without BOM. The returned Vec<u8> is the input buffer unchanged when it is already UTF-8 with no BOM (zero-copy fast path).