All Manuals > LispWorks User Guide and Reference Manual > 26 Internationalization: characters, strings and encodings

NextPrevUpTopContentsIndex

26.6 External Formats

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:

win32:code-page

The Windows code page with identifier given by the :id parameter. Implemented only on Windows.

:latin-1

ISO8859-1.

:latin-1-terminal

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.

:latin-1-safe

As Latin-1, except that if a non-Latin-1 character is output, it is written as ? and does not signal error.

:macos-roman

The Mac OS Roman encoding.

:ascii

ASCII.

:unicode

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

:utf-8

The UTF-8 encoding of Unicode.

:utf-16

The UTF-16 encoding of Unicode with big-endian byte order. See 16-bit External formats guide for details and variants.

:utf-32

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.

:bmp

Reads and writes 16-bit characters with native byte order. See 16-bit External formats guide for details and variants.

:jis

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

EUC-JP. The encoding data is read from a file Uni2JIS and is pre-built into LispWorks.

:sjis

Shift JIS.

:windows-cp936

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.

:gbk

A synonym for :windows-cp936.

:koi8-r

The KOI8-R (RFC 1489) encoding.


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex