Skip to main content

detect_encoding

Function detect_encoding 

Source
pub fn detect_encoding(bytes: &[u8]) -> Encoding
Expand description

Detect the text encoding from a sample of bytes

This function delegates to detect_encoding_or_binary and returns only the encoding, ignoring the binary flag. Use detect_encoding_or_binary when you need to know if the content should be treated as binary.