All Manuals > LispWorks® User Guide and Reference Manual > 36 The EXTERNAL-FORMAT Package

find-external-char Function

Summary

Returns the character of a given code in a specified character set.

Package

external-format

Signature

find-external-char code set => char

Arguments
code
A character code. This is an integer.
set
A character set. Legal values for set are :unicode, :latin-1, :ascii, :macos-roman, :jis-x-208, :jis-x-212, :euc-jp, :sjis, :koi8-r, :windows-cp936 and :gbk. Additionally, on Windows, set can be a valid Windows code page identifier.
Values
char
The character represented by code. If code is not a legal code in the specified set, the return value is undefined.
Description

The function find-external-char returns the character that has the code code (an integer) in the coded character set specified by set, or nil, if that character is not represented in the Lisp character set. Note that a coded character set is not the same thing as an external format.

If set is :jis-x-208 or :jis-x-212 then code is the KUTEN index (from the 1990 version of these standards) encoded as:

(+ (* 100 row) column)

If set is :euc-jp then code is the complete two-byte format encoded as:

(+ (* 256 first-byte) second-byte)

If set is :sjis then code is Shift-JIS encoded in the same way. Strictly speaking, EUC and Shift-JIS are not coded character sets, but encodings of the JIS sets, but the encoding is easily expressed as an integer, so the same interface to it is used.

See also

26.6 External Formats to translate Lisp characters from/to external encodings
char-external-code


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:34