Implement reading and writing of 16-bit characters only (excluding supplementary characters).
The external format :bmp
and its variants implement reading and writing of 16-bit characters only (excluding supplementary characters).
:bmp-native
and :bmp-reversed
are the actual implementation formats. They implement reading and writing 16-bit characters with the native byte order (:bmp-native
) or the reversed byte order (:bmp-reversed
).
:bmp
implements reading and writing 16-bit characters with control over the byte order. This format maps to either :bmp-native
or :bmp-reversed
as appropriate.
If little-endian is supplied, it determines the byte order. Otherwise, if it is used for opening a file, the system checks whether the file starts with the BOM (Byte Order Mark), and if so it uses it. Otherwise the native byte order is used. The system uses the required byte order and the native byte order of the computer it executes on to decide whether to use :bmp-native
or :bmp-reversed
.
When writing, these :bmp
external formats signal an error when trying to write supplementary characters (code greater than #xffff
).
:bmp
cannot read surrogate code points. When encountering a surrogate code point it either signals an error (the default), or if use-replacement is non-nil, replaces it with the replacement character. When use-replacement is non-nil, these external formats never signal an error when reading.
These formats are new in LispWorks 7.0. In LispWorks 6.1 and earlier versions :unicode
is the external format to read 16-bit characters. Other than the treatment of surrogate code points, :bmp
now does what :unicode
used to do.
LispWorks User Guide and Reference Manual - 13 Feb 2015