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