Skip to main content

decode_text

Function decode_text 

Source
pub fn decode_text(data: &[u8], charset: Option<&str>, html: bool) -> String
Expand description

A text part’s characters: by its byte order mark, else its charset, else the charset it declares itself, else UTF-8 when it is valid UTF-8, else windows-1252 (as browsers read undeclared Latin text). Labels are WHATWG’s, so iso-8859-1 reads as windows-1252, as in browsers.