Expand description
Binary content detection heuristics.
Binary content detection powered by the content_inspector crate (G41).
The previous implementation used a simple null-byte heuristic, which
misclassified UTF-16LE and UTF-16BE without BOM as binary (because every
ASCII char in UTF-16LE is followed by a 0x00 byte). content_inspector
performs BOM detection, UTF-8/16/32 validation, and statistical analysis
to correctly classify text in any of the four Unicode encodings.
Enums§
- Content
Type - The detected content type of a buffer.
Functions§
- detect_
content_ type - Detect the content type of a buffer.
- is_
binary - Detect whether data is binary.