setmaps File Format

Purpose

Defines the text of a code-set map file and a terminal map file.

Description

The text of a code set map file consists of a description of the code set. The text of a terminal map file consists of a set of rules.

Code-Set Map File

The text of a code set map file is a description of the code set. It specifies the optional converter modules to push on the stream. The code set map file is located in the /usr/lib/nls/csmap directory. Its name is the code set name.

The code set map file contains the following lines:

Item Description
Name : name
Type : M | S
Multibyte handling : EUC
ioctl EUC_WSET : w1:d1, w2:d2, w3:d3
lower converter : /usr/lib/drivers/lwconv
upper converter : /usr/lib/drivers/upconv

The lines have the following meaning:

Item Description
Name Specifies the code set name. It is also the code set map file name.
Type Specifies the code set type. It can be one of the following:
M
Denotes a multibyte code set.
S
Denotes a single byte code set.
Multibyte handling Specifies the type of multibyte handling of the code set. This line is required only if Type is M. It must be EUC, denoting an EUC multibyte code set.
ioctl EUC_WSET Specifies the parameters for the EUC_WSET ioctl operation. This line is required only if Type is M. The w1, w2, and w3 parameters specify the memory width of the code set; the d1, d2, and d3 parameters specify the screen width of the code set.
lower converter  
upper converter Specifies the lower and upper converters to use on the stream. This line is required only if the code set is a non-EUC multibyte code set.

For example, the code set map file for the ISO 8859-1 code set would contain the following lines:

Name:   ISO8859-1
Type:   S

Another example: the code set map file for the IBM-943 code set would contain the following lines:

Name :                  IBM-943
Type :                  M
Multibyte handling :    EUC
ioctl EUC_WSET :        2:2,1:1,2:2
lower converter :       /usr/lib/drivers/lc_sjis
upper converter :       /usr/lib/drivers/up_sjis

Terminal Map File

The text of a terminal map file is a set of rules. Each rule has the following format:

pattern:replacement

The size of the input pattern string is limited to 10 characters in length and the size of the replacement pattern string is limited to 16 characters in length.

The pattern string can include the following special characters:

Item Description
? Matches any single byte.
@x Matches this rule only if the pattern processor is in state x, where x is any single byte. (This sequence does not match a character in the input buffer.)
\?, \@, or \\ Prevents the pattern processor from interpreting ? (question mark), @ (at sign), or \ (backslash) as special characters.
\ddd Represents any byte in octal notation.
\xdd Represents any byte in hexadecimal notation.

The replacement string can include the following special characters:

Item Description
$n Uses the nth character in the input string that matched this pattern, where n is a decimal digit.
@x Moves the pattern processor into state x. (This sequence does not become part of the replacement string.)
\$, \@, or \\ Prevents the pattern processor from interpreting $, @, or \ as special characters.
\ddd Represents any byte in octal notation.
\xdd Represents any byte in hexadecimal notation.

Files

Item Description
/usr/lib/nls/csmap/sbcs Code set map for a single-byte code page
/usr/lib/nls/csmap/IBM-932 Code set map for the IBM-932 code page
/usr/lib/nls/csmap/IBM-943 Code set map for the IBM-943 code page
/usr/lib/nls/csmap/IBM-eucJP Code set map for the IBM-eucJP code page
/usr/lib/nls/csmap/IBM-eucKR Code set map for the IBM-eucKR code page
/usr/lib/nls/csmap/IBM-eucTW Code set map for the IBM-eucTW code page
/usr/lib/nls/termmap/*.in Input map files
/usr/lib/nls/termmap/*.out Output map files