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

NextPrevUpTopContentsIndex

specific-valid-file-encoding

Function
Summary

Provides an encoding chosen from list of specific encodings if valid.

Package

system

Signature

specific-valid-file-encoding pathname ef-spec buffer length => new-ef-spec

Arguments

pathname

Pathname identifying location of buffer.

ef-spec

An external format spec.

buffer

A buffer whose contents are examined.

length

Length (an integer) up to which buffer should be examined.

Values

new-ef-spec

Default external format spec created by merging ef-spec with the encoding that was found to be valid.

Description

The function specific-valid-file-encoding tests each element of *specific-valid-file-encodings* to see if it is valid for the contents of buffer, bounded by length. The first valid encoding is returned. For input files, buffer will contain the start of the file, so it is assumed that it contains a representative sample. For output files, buffer will have length 0, so the first element of *specific-valid-file-encodings* will always be returned.

pathname is ignored.

Notes

You need to set *specific-valid-file-encodings* for specific-valid-file-encoding to have any effect. The default value of *specific-valid-file-encodings* is nil, which causes specific-valid-file-encoding to return ef-spec unchanged.

See also

*specific-valid-file-encodings*
*file-encoding-detection-algorithm*


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex