This chapter describes features specific to the Thai locale in Tru64 UNIX that are not described elsewhere.
Tru64 UNIX provides a Thai terminal driver to handle Thai character processing in character cell terminal applications. The following features are supported:
To activate the Thai terminal driver, enter the following command:
The Thai terminal driver supports the following input sequence check modes:
To switch the input sequence check mode, you can use the following command:
% stty isc <mode>
In this example <mode> can name one of the following values:
For details, see Chapter 7.
The WTT input sequence check modes can only accept Thai data in the following sequences:
To provide more freedom to enter Thai data in different orders, such as entering top level (L1) characters before upper level (L2) or lower level (L4) characters, the Thai terminal driver provides a Thai character reordering mechanism. Through this mechanism, you can enter data in arbitrary order and the terminal driver will reorder the data stream before sending it to applications.
To activate the Thai character reordering mechanism, enter the following command:
% stty reorder
To deactivate it, enter the following command:
% stty -reorder
Note
This feature is not available in the History mode described in the next section.
The Thai terminal driver provides a history mechanism for you to recall and edit a previously entered command.
You can use the stty command to activate the history mode and define a hot key (usually a control key sequence) for invoking the history mode. For example, the following command defines the hot key to be [Ctrl/P]:
% stty thistory ^P
Once the hot key is defined, the Thai terminal driver will keep the history of up to 32 command lines. To invoke the history mode, you can press [Ctrl/P].
In the history mode, you can use the following control key sequences or arrow keys for editing:
Key Sequence |
Function |
---|---|
[Ctrl/A] |
Moves to the beginning of command line |
[Ctrl/E] |
Moves to the end of command line |
[Ctrl/D] |
Deletes the whole cell under the cursor |
[erase] |
Deletes the character before the cursor |
[werase] |
Deletes the word before the cursor |
Ý [up arrow] |
Recalls the previous command line |
ß [down arrow] |
Recalls the next command line |
Ü [left arrow] |
Moves the cursor left by one cell |
Þ [right arrow] |
Moves the cursor right by one cell |
By default, the designated key sequences for the [erase] and [werase] functions are:
Note
The history mode is available only when character echoing is turned on. For details, please see the manual pages of stty.
Thai DECterm is a VT382-T terminal emulator. This section describes the Thai features which are specific to Thai DECterm. For the details about the common features provided by the internationalized DECterm, see Writing Software for the International Market.
This section describes the following Thai DECterm features:
The terminal type that DECterm will emulate is sensitive to the session language.
To create a Thai DECterm window through the Session Manager, you can set the session language to Thai, and then select DECterm from the Applications menu of the Session Manager.
Alternatively, you can use the -xnllanguage qualifier to specify the terminal type of the DECterm window to create. To get the Thai DECterm window, enter the following command:
% /usr/bin/X11/dxterm -xnllanguage th_TH
If you specify an unknown value for the -xnllanguage qualifier, then ISO Latin-1 DECterm is assumed. If no Thai font exists, it defaults to ISO Latin-1 DECterm.
The user interface language of Thai DECterm always follows the terminal type. The language is independent of the language selection.
You can apply to your Thai DECterm windows any of the customization features that are currently applicable to the ISO Latin-1 DECterm window, except for the customization of the NRCS character sets.
Customized features can be saved and restored in the same way as in ISO Latin-1 DECterm.
By selecting the Big Font, Little Font, or Fine Font option from the Window Options dialog box, you can use the 12x24, 8x18, or 7x14 Thai fonts.
You can select the following terminal identifier for Thai DECterm from the General Options dialog box:
You can use the Edit menu to copy information within or between Thai DECterm windows. The Cut-and-Paste operation is enhanced to handle mixed ASCII and Thai characters.
Thai DECterm supports TIS 620-2533 and all character sets supported by ISO Latin-1 DECterm.
ISO Latin-1 DECterm uses ISO 8859-1 as the default character set. ISO 8859-1 contains ASCII characters, Latin-letters-with-diacritics, and other symbols used in Western European languages. This can be overridden by other options in the General Options dialog box. For Thai DECterm, the default character set for 8-bit data is TIS 620-2533.
In general, Thai DECterm cannot display a mixture of ISO Latin-1 and Thai characters. If you really want to achieve this function, you can output the data together with the designated character set escape sequences.
When a Thai DECterm window is created, it is in the English input mode.
You can enter Thai characters in Thai DECterm by invoking the Thai input mode as described in Chapter 7. Mixed ASCII and Thai characters can be displayed properly on the Thai DECterm window without any special settings.
You can select your desired Input Sequence Check Mode from the General Options dialog box:
For the details about input sequence check modes, see Chapter 7.
Thai DECterm supports two display modes. You can select one of the following display modes from the General Options dialog box:
The normal operation mode displays whatever is received from the host.
The design philosophy of the VT382-T Thai terminal is to build more knowledge about Thai processing into the terminal. Most software packages, as long as they are 8-bit clean, can have Thai language features without reengineering.
One of the features is Space Compensating Mode.
When VT382-T receives two consecutive space characters followed by a nonspace1 or an escape sequence, it will:
– Calculate the new update position of the screen buffer which is equal to the total number of characters in the logical buffer.
– Fill the contents of the screen buffer by inserting spaces between the nonspace cell on the left and the newly calculated screen buffer position, exclusively, such that the length of the logical buffer is equal to that of the screen buffer.
– Reformat the current line.
1Nonspace characters refer to all characters other than the space character (0x20). Do not confuse them with nonspaced characters which refer to top level, upper level and lower level Thai characters.This output method allows output lines formatted in a tabular fashion to be displayed correctly without software (for example, spreadsheet and database management packages) taking too much care about the spacing of table columns.
Thai DECterm also emulates the space compensating mode supported by VT382-T. In addition to the behavior described above, two enhancements have been added:
By default, the space compensation control character is the space character (0x20) and the number of control characters is 2. You can modify this parameter from the General Options dialog box.
In Thai DECterm, the actual cursor position on the screen is calculated from the logical buffer pointer. The column number specified by the cursor positioning command is the offset from the beginning of the specified line in the logical buffer. Actual cursor position on the screen will be the corresponding screen position to the character pointed to by the logical buffer pointer.
The following functionalities of VT382-T are also implemented in Thai DECterm:
For the details about the VT382-T functionalities, refer to VT382-T Programming Reference Manual and VT382-T User's Manual.
This section describes the CSText editing functions that are specific to Thai. For details about other features of the CSText widget, refer to Writing Software for the International Market.
CSText supports cursor movement by display cell. When the cursor-left or cursor-right key is pressed, the cursor moves one cell to the left or right. Thus, it may move past 1, 2, or 3 character positions, depending on the number of nonspaced characters at the cursor position.
When the cursor position is changed by a call to either DXmCSTextSetInsertionPosition or DXmCSTextSetCursorPosition, the cursor position is specified in number of characters from the beginning of the widget. The widget may adjust this position to ensure that the new cursor position is located on a display cell boundary. Users should not assume that the cursor is set to exactly the position specified. The DXmCSTextGetInsertionPosition funtion can be called after the cursor is set to get the actual cursor position.
When the delete key is pressed, the previous character is deleted. If a display cell contains three Thai characters, must press the [Delete] key three times to delete the whole cell.