[−][src]Crate xhtmlchardet
Basic character set detection for XML and HTML in Rust.
Example
use std::io::Cursor; extern crate xhtmlchardet; let text = b"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><channel><title>Example</title></channel>"; let mut text_cursor = Cursor::new(text.to_vec()); let detected_charsets: Vec<String> = xhtmlchardet::detect(&mut text_cursor, None).unwrap(); assert_eq!(detected_charsets, vec!["iso-8859-1".to_string()]);
Functions
detect | Attempt to detect the character set of the supplied byte stream. |