Skip to main content

encoding_of

Function encoding_of 

Source
pub fn encoding_of(bytes: &[u8]) -> Result<Encoding, Error>
Expand description

The encoding decode reads bytes in, without decoding them: what the first bytes say, and, unless they say UTF-16, what the XML declaration names.

ยงErrors

As decode, for an encoding not read or an XML declaration naming UTF-16 in a document that is not; the declaration of a UTF-16 document is only checked when it is decoded.