Implements BOM sniff legacy hook.
Given a TypedArray or an ArrayBuffer instance input, returns either of:
TypedArray
ArrayBuffer
input
'utf-8'
'utf-16le'
'utf-16be'
null
The bytes to check for BOM
The encoding ('utf-8', 'utf-16le', 'utf-16be'), or null if no BOM found
Implements BOM sniff legacy hook.
Given a
TypedArrayor anArrayBufferinstanceinput, returns either of:'utf-8', ifinputstarts with UTF-8 byte order mark.'utf-16le', ifinputstarts with UTF-16LE byte order mark.'utf-16be', ifinputstarts with UTF-16BE byte order mark.nullotherwise.