The sequence to check for the BOM
the found BOMSeq corresponding to the passed input.
import std.format : format; auto ts = dchar(0x0000FEFF) ~ "Hello World"d; auto entry = getBOM(cast(ubyte[]) ts); version (BigEndian) { assert(entry.schema == BOM.utf32be, format("%s", entry.schema)); } else { assert(entry.schema == BOM.utf32le, format("%s", entry.schema)); }
Returns a BOMSeq for a given input. If no BOM is present the BOMSeq for BOM.none is returned. The BOM sequence at the beginning of the range will not be comsumed from the passed range. If you pass a reference type range make sure that save creates a deep copy.