Skip to main content

has_utf8_bom

Function has_utf8_bom 

Source
pub const fn has_utf8_bom(input: &[u8]) -> bool
Expand description

Whether the byte slice carries a UTF-8 BOM (EF BB BF).

Used by the CLI to strip the BOM before handing input to the parser. The CLI requires an explicit --encoding flag, so BOM presence is the only runtime signal we care about. A full encoding sniffer (BOM + byte-frequency heuristic) is intentionally out of scope until unknown-encoding input streams become a concern.