Skip to main content

decode_xml_octets

Function decode_xml_octets 

Source
pub fn decode_xml_octets(bytes: &[u8]) -> Result<Cow<'_, str>, XmlEncodingError>
Expand description

Decode XML 1.0 octets encoded as UTF-8 or UTF-16.

UTF-16 is recognized from a BOM or the XML declaration byte signature. BOM-less input must declare the matching explicit UTF-16LE or UTF-16BE encoding. Transcoded declarations are normalized to UTF-8 because the returned Rust text is subsequently serialized as UTF-8.