An “encoding” describes the correspondence
between CHARACTERs and raw bytes during input/output via
STREAMs with STREAM-ELEMENT-TYPE CHARACTER.
An EXT:ENCODING is an object composed of the following facets:
CHARACTERs that
can be represented and passed through the I/O channel, and the way
these characters translate into raw bytes, i.e., the map between
sequences of CHARACTER and (UNSIGNED-BYTE 8) in the form of STRINGs
and (VECTOR (UNSIGNED-BYTE 8)) as well as character and byte STREAMs.
In this context, for example, CHARSET:UTF-8 and CHARSET:UCS-4
are considered different, although they can represent the same set
of characters.EXT:ENCODINGs are also TYPEs. As such, they represent the set of
characters encodable in the character set. In this context, the way
characters are translated into raw bytes is ignored, and the line
terminator mode is ignored as well. TYPEP and SUBTYPEP can be used
on encodings:
(SUBTYPEPCHARSET:UTF-8CHARSET:UTF-16) ⇒; ⇒T(TSUBTYPEPCHARSET:UTF-16CHARSET:UTF-8) ⇒; ⇒T(TSUBTYPEPCHARSET:ASCII CHARSET:ISO-8859-1) ⇒; ⇒T(TSUBTYPEPCHARSET:ISO-8859-1 CHARSET:ASCII) ⇒; ⇒NILT