pub fn prescan(bytes: &[u8]) -> Option<&'static Encoding>Expand description
The encoding a <meta> (or an XML declaration) in bytes declares, as
the HTML Standard’s prescan finds it, reading bytes and nothing
past them. crate::sniff gives it the first 1,024 bytes, as the
spec advises; pass more or fewer to scan further or less.
let found = parsec_encoding::prescan(b"<meta charset=shift_jis>");
assert_eq!(found, Some(encoding_rs::SHIFT_JIS));