A wrapper around the uchardet library. Detects character encodings.
Note that the underlying implemention is written in C and C++, and I'm
not aware of any security audits which have been performed against it.
use uchardet::detect_encoding_name;
assert_eq!("WINDOWS-1252",
detect_encoding_name(&[0x46, 0x93, 0x72, 0x61, 0x6e, 0xe7, 0x6f,
0x69, 0x73, 0xe9, 0x94]).unwrap());
For more information, see this project on
GitHub.
detect_encoding_name |
Return the name of the charset used in data or an error if uchardet
was unable to detect a charset.
|