All Manuals > LispWorks User Guide and Reference Manual > 40 The SYSTEM Package

NextPrevUpTopContentsIndex

*file-encoding-detection-algorithm*

Variable
Summary

List of functions to call to work out an encoding.

Package

system

Initial value
(find-filename-pattern-encoding-match 
 find-encoding-option
 detect-unicode-bom
 locale-file-encoding)
Description

Functions on this list take four arguments--the pathname of the file; an external format spec; a vector of element-type (unsigned-byte 8) which contains the first bytes of the file; and a non-negative integer which is the maximum extent of buffer to be searched. This length argument is 0 in the case that the file does not exist, or the direction is :output . They return an external format spec, which normally is either ef-spec unmodified, or the result of merging ef-spec with another external format spec via merge-ef-specs .

Example

If you want open and so on, when opening a file for input, to inspect the attribute line and then fall back to a default if no attribute line is found, then set the variable to this value:

(find-encoding-option locale-file-encoding)

There are further examples in Guessing the external format.

See also

find-filename-pattern-encoding-match
find-encoding-option
detect-unicode-bom
detect-japanese-encoding-in-file
guess-external-format
locale-file-encoding


LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex