Skip to main content

decode

Function decode 

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

Decode bytes into text the parser can read.

The encoding is determined in the order the specification requires: a byte-order mark wins, then the encoding pseudo-attribute of the XML declaration, then UTF-8 by default.

ยงErrors

Returns Error if the declared encoding name is not a legal EncName, if it names an encoding this crate cannot decode, or if the bytes are not valid in the encoding they claim.