NextPrevUpTopContentsIndex

locale-file-encoding

Function
Summary

Provides an encoding ccorresponding to the current code page on Windows, and the locale on Unix.

Package

system

Signature

locale-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.

Description

The function locale-file-encoding consults the ANSI code page in Windows. If the code page identifier is in win32:*latin-1-code-pages* , locale-file-encoding merges ef-spec with (:latin-1 :encoding-error-action 63) . This external format writes Latin-1 on output, using 63 (ASCII '?') to replace any non-Latin-1 characters in the output. Otherwise locale-file-encoding merges ef-spec with an encoding corresponding to the current code page.

locale-file-encoding currently returns :latin-1 on Unix.

See also

*file-encoding-detection-algorithm*
*latin-1-code-pages*


LispWorks Reference Manual - 6 Apr 2005

NextPrevUpTopContentsIndex