PreviousPrinting Setting Up the Configuration FileNext

Chapter 15: Character Set Support on UNIX

Dialog System on UNIX supports the use of character sets other than the standard ASCII character set. This chapter describes:

15.1 DOS and UNIX Screensets

Dialog System supports two types of screenset; DOS screensets and UNIX screensets.

15.1.1 DOS Screensets

A DOS screenset is one that contains only data in the extended DOS character set.

All screensets you create on a DOS system are DOS screensets. Screensets you create on a UNIX system are DOS screensets unless you specify a configuration parameter in the configuration file (see the section UNIX Screensets later in this chapter). DOS screensets can run on UNIX systems, with the following restrictions (by default):

If your UNIX terminal supports the extended DOS character set, you can specify the configuration parameter TERMINAL DOS8 (see the chapter Setting Up the Configuration File for details). This parameter removes the above restrictions on running DOS screensets on UNIX systems.

15.1.2 UNIX Screensets

By default, screensets you create on a UNIX system are DOS screensets. However, you can set the configuration parameter TERMINAL GENERIC8 in your configuration file, so that all screensets you create are UNIX screensets.

You can create UNIX screensets only on a UNIX system, and UNIX screensets are not portable to DOS systems.

See the chapter Setting Up the Configuration File for more details of these configuration parameters.

UNIX screensets support character sets containing non-English characters, such as ISO-8859 and HPRoman8 (HP LaserJet ROMAN-8).

UNIX screensets also support the use of line-drawing characters, even where the character set itself does not include line-drawing characters. All line-drawing characters in a UNIX screenset are stored internally as characters in the range hex 00 to hex 1F (the unused range of the character set). The internal representation of line-drawing characters is as follows:

01 up arrow
02 down arrow
03 right arrow
04 left arrow
05 top left corner
06 top right corner
07 bottom right corner
08 bottom left corner
09 cross lines
10 vertical line
11 horizontal line
12 left tee
13 right tee
14 bottom tee
15 top tee

When the screenset is loaded, these internal characters are converted to the line-drawing characters expected by the terminal in use, as defined in terminfo. If no line-drawing characters are defined, characters in the internal format are converted to simple character equivalents.

If a screenset has been designed and saved as a UNIX screenset, users must also have the TERMINAL GENERIC8 configuration parameter set when they run the screenset so that non-English and line-drawing characters are handled correctly. Screenset Naming

If you intend to transfer a screenset from UNIX to DOS, remember to name it in upper case, because DOS supports upper case only.

15.2 The Screenset Conversion Utility

You can use the utility, SSTRAN, to either convert between screensets using the extended DOS character set, and screensets using DOS, Windows or OS/2 character sets, or convert attributes in a screenset. You can also use the utility to convert between different DOS character sets (codepages).

To use the conversion utility, enter a command line of the form:

cobrun SSTRAN -a [-y] input-screenset  output-screenset  translation-file

where the parameters are:

-a A flag indicating that this is an attribute conversion.
-y An optional parameter that is equivalent to the user responding "yes" to each prompt produced by the utility. The only prompt currently produced asks the user to confirm that they wish to overwrite the input screenset with the output screenset; this occurs when you specify the same filename for input-screenset and output-screenset.
input-screenset The filename (including path) of the screenset to be converted. This can be up to 65 characters long.
output-screenset The filename (including path) of the converted screenset. This can be up to 65 characters long. The output filename before the file extension must be identical to the input filename. You can use the same, or a different file extension.
translation-file The filename (including path) of the translation file that controls the conversion. See the next section for details.

Text and attributes cannot be converted at the same time: a separate run is needed for each.

15.2.1 Translation Files

A translation file is an ASCII text file that controls the operation of the SSTRAN screenset conversion utility.

A translation file can contain the following types of entry:

Any line beginning with "*" is treated as a comment. You can also include blank lines.

Directives indicate to SSTRAN whether the input and output screensets are DOS or UNIX. The following directives are available:


A translation file must contain one SOURCE directive and one TARGET directive.

A translation table is a series of lines that describe the character substitutions to be performed. Each line controls the setting of 16 bytes, and has the form:

hex-digit  X"hex-string"


hex-digit specifies which 16 bytes in the character set are controlled by this line. For example, the digit B indicates that this line controls the translation of characters in the range hex B0 to hex BF.
hex-string specifies the characters to which the input characters are to be converted.

For example, to convert input characters in the range hex B0 to hex BF into the uppercase alphabetic characters ABCDEFGHIJKLMNOP, you would specify the following translation line:

B  X"4142434445464748494A4B4C4D4E4F50"

To leave some characters unconverted, specify hex 00 in the appropriate position in the conversion string. Using the previous example, to leave the characters B5, B6, and BF unconverted, you would specify the following translation line:

B  X"4142434445000048494A4B4C4D4E4F00"

If none of the corresponding characters are to be converted, so the entire translation line would contain 00, you do not have to specify a line in the translation table for the range.

Micro Focus provides a number of text translation files:

Translation File
DOS codepage 437 to UNIX
DOS codepage 437 to ISO 8859
DOS codepage 850 to ISO 8859
DOS codepage 850 to HPRoman8
DOS codepage 850 to UNIX

These files contain detailed comments about translation file format.

15.2.2 Attribute Conversion

When converting attributes, you do not need to define the screenset type, so the SOURCE and TARGET directives are not required. To ensure that a text translation file is not used instead of an attribute translation file, and vice versa, we recommend that you do not include SOURCE and TARGET directives in the attribute tranlsation file.

To leave some characters unconverted, specify hex FF in the appropriate position in the conversion string.

If none of the corresponding characters are to be converted, so the entire translation line would contain FF, you do not have to specify a line in the translation table for the range.

Micro Focus provides two attribute translation files:

Translation File

Colors in a screenset to monochrome attributes supported by DOS
Old style UNIX monochrome attributes (DS1.1) to new fully portable style

Note: Attribute conversion is not limited to UNIX. It is available under all platforms mentioned in this manual.

15.3 Transferring DOS Screensets to UNIX

Dialog System enables you to execute screensets that have been defined on DOS, on a UNIX system.

You can transfer screensets from the DOS creation environment into the appropriate UNIX directory using a binary transfer method.

15.3.1 Restrictions on Line-drawing Characters

When you transfer screensets from a DOS to a UNIX environment, UNIX imposes the following limitations on line-drawing. The limitations apply only to the display; the data actually stored is not affected.

Note: These restrictions do not apply if you use the TERMINAL DOS8 configuration parameter.

15.3.2 Supported UNIX Characters

If you do not specify the TERMINAL DOS8 configuration parameter described earlier in this chapter, the set of UNIX characters supported contains the ASCII characters in the range space to tilde (~), that is hexadecimal values 20 to 7e, and the following single-line drawing characters:

up arrow
down arrow
right arrow
left arrow
top left of box
top right of box
bottom right of box
bottom left of box
cross lines
vertical line

horizontal line
left tee
right tee
bottom tee
top tee

The actual graphic characters are machine dependent. If your system does not support these characters, the equivalent ASCII characters are displayed.

15.3.3 Modifying File Names in Your Application

When you move the screensets from DOS to UNIX and create your COBOL application, you might need to modify some of the filenames in your application. This is because the filename of a screenset must match exactly the filename for that screenset as it appears in your COBOL source code. If the filenames do not match, you must modify either the file name of the screenset or your application program so that the names correspond exactly.

This is more important when you transfer screensets from DOS to UNIX, because UNIX leaves the case and capitalization of filenames exactly as they were originally entered, whereas DOS systems convert all filenames entered to upper case. When your application program calls Dsrun to request a screenset, Dialog System searches for a screenset with the exact same filename as specified in your program. In a UNIX system, if the capitalization of the screenset filename does not match exactly, Dsrun cannot find the requested screenset and an error message is returned. For example, if your application program contains the following:

     move "DStutor" to DS-set-name

Dsrun searches for DStutor.s. It does not search for any variations in capitalization such as "DSTUTOR" or "dstutor". So, if this screenset appears as "DStutor" in your application program but has a filename of "DSTUTOR", Dsrun cannot find it.

Dialog System automatically adds an .s extension to your screenset filename, so you do not have to specify the extension yourself. If you do specify the extension, Dialog System searches for the extension in the case that you specify.

These rules on case sensitivity also apply to any error message files. These files must be in the working directory at run time.

Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
PreviousPrinting Setting Up the Configuration FileNext