Pathname identifying the location of buffer.
An external format spec.
A buffer whose contents are examined.
Length (an integer) up to which buffer should be examined.
A new external format spec created by merging ef-spec with the encoding that was found.
These functions are called as part of open's encoding detection routine, and try to detect the encoding if it is not already supplied in the external-format argument.
These functions work by checking whether the file starts with the Unicode character
#xFEFF (BOM) encoded in the relevant encoding, and if it does assumes the file is encoded in this encoding.
detect-utf32-bom also deduce the direction (little-endian or big-endian).
Note that files starting with
0xff 0xfe 0x00 0x00 can match both UTF-16 and UTF-32 little-endian. By default
detect-utf32-bom is applied first, because it precedes
detect-unicode-bom in *file-encoding-detection-algorithm*. You can change this behavior by altering the order of functions in *file-encoding-detection-algorithm*.
LispWorks User Guide and Reference Manual - 20 Sep 2017