External formats are two-way translations from Lisp's internal encoding to an external encoding. They can be used in file I/O, and in passing and receiving string data in foreign function calls.
An external format is named in LispWorks by an external format specification (ef-spec). An ef-spec is a symbol naming the external format, or a list with such a name as its first element followed by parameter/value pairs.
LispWorks has a number of predefined external formats:
The Windows code page with identifier given by the :id
parameter.
Implemented only on Windows.
As Latin-1, except that if a non-Latin-1 character is output, it is written as <xxxx>
where xxxx
is the hexadecimal character code and does not signal error.
As Latin-1, except that if a non-Latin-1 character is output, it is written as ?
and does not signal error.
:utf-16 with default native byte order. See 16-bit External formats guide for details and variants.
Compatibility note:
In LispWorks 6.1 and earlier versions,
:unicode
encodes 16-bit characters reading.
The UTF-8 encoding of Unicode.
The UTF-16 encoding of Unicode with big-endian byte order. See 16-bit External formats guide for details and variants.
The UTF-32 encoding of Unicode with big-endian byte order.
Note: There is a :utf-32 external format corresponding to each of the :utf-16 variants.
Reads and writes 16-bit characters with native byte order. See 16-bit External formats guide for details and variants.
JIS. The encoding data is read from a file Uni2JIS
and is pre-built into LispWorks.
Note:
Uni2JIS
is provided by way of documentation in the directory lib/7-1-0-0/etc/
. It is also used at run time by the function cl:char-name
.
EUC-JP. The encoding data is read from a file Uni2JIS
and is pre-built into LispWorks.
Windows code page 936. The encoding data is read from a file windows-936-2000.ucm
and is pre-built into LispWorks.
Note:
windows-936-2000.ucm
is provided by way of documentation in the directory lib/7-1-0-0/etc/
. It is not read at run time.
The KOI8-R (RFC 1489) encoding.
LispWorks User Guide and Reference Manual - 20 Sep 2017