Specifications
4-39
Printer, Plotter, and Spooler Subsystem Programming
Printer Code Page Translation for Multibyte Code Sets
Multibyte code set (MBCS) translation from the print file to the code set differs from
translation for single–byte code set (SBCS) code points. Translation from print file to code
set in multibyte environments is a two–stage process.
During the first stage of code–set translation, the input code set of the print file is translated
to a process code set. The process code set must be one of the MBCS code sets supported
by the iconv subroutine and locale database (DB), examples include the IBM–943,
IBM–eucTW, and IBM–eucKR code sets. During the second stage, the process code set is
translated to an appropriate output code set for the printer. The iconv subroutine translates
the code set, if the iconv converter for the translation exists. When the input or output code
set and process code are the same, no code–set translation is performed.
The Ti and To attributes in the printer–dependent colon files define the possible flow of the
translating code set. The Ti attribute specifies the combination of the input and process
code sets:
[Input_code_set, ... ]Process_code_set, ...
The To attribute specifies the combination of the process and output code:
Process_code_set [Output_code_set0, Output_code_set1,
Output_code_set2, Output_code_set3,... ], ...
For example, the To attribute for a Japanese printer is defined as:
::To::IBM–943[IBM–932, IBM–932, IBM–932], ibm–eucJP[IBM–932,
IBM–932, IBM–932,IBM–932]
All characters of the character set ID (CSID) are printed using ROM fonts when an output
code set is specified for each CSID. Otherwise, bitmap images from the Xwindows font are
used. The type of Xwindows font files, including the font image of each CSID, is selected by
reading a file from the /usr/lib/X11/nls directory.
Printer Code Page Translation Tables for Multibyte Code Sets
A translation table consists of maps between code points that are not shared by the two
code sets. A printer backend can communicate with other code sets even if the code set is
not supported by the iconv subroutine by using a translation table provided in the
/usr/lib/lpd/pio/transJP directory.
When an input or an output code set is not supported by the iconv subroutine, the
unsupported code set translates one of the code sets that are supported or directly to a
process code set using the translation tables found in the /usr/lib/lpd/pio/transJP directory.
Users with root authority can add new code sets for printers by creating translation tables.
The naming convention for new translation tables is FromCodeSetName _
ToCodeSetName. All translation tables must be defined in the trans_dir file. The f_cp from
code point in a translation table must be sorted in alphabetical order in advance.
The trans_dir and codeset.alias files are in the /usr/lib/lpd/pio/transJP directory. The
trans_dir file format is:
FromCodeSetName ToCodeSetName NameofTranslationFile
Code set aliases are defined in the codeset.alias file. The codeset.alias file format is:
CodeSetName AliasName ...
For example, to print an MBCS file that was written with a new code set on an IBM–943
printer, use the following steps:
1. Create a translation table in the /usr/lib/lpd/pio/transJP directory. The naming
convention for the new file is NewCodeSetName _IBM–943.