NextPrevUpTopContentsIndex

char-external-code

Function
Summary

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

Package

external-format

Signature

char-external-code char set => code

Arguments

char

The character whose code you wish to return.

set

A character set. Legal values for set are :unicode , :latin-1 , :ascii , :macos-roman , :jis-x-208 , :jis-x-212 , :euc-jp and :sjis. Additionally, on Windows, set can be a valid Windows code page identifier.

Values

code

The code of char in the character set set . An integer.

Description

Returns the code of the character char in the coded character set specified by set , or nil , if there is no encoding. Note that a coded character set is not the same thing as an external format.

For the set parameter, the :jis-* codes are KUTEN indexes (from the 1990 version of these standards) encoded as

(+ (* 100 row) column)

:euc-jp is the complete two-byte format encoded as

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

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

find-external-char


LispWorks Reference Manual - 20 Jul 2006

NextPrevUpTopContentsIndex