Chapter 6: National Character Sets

When you install Reflection 8, you can select one of the following
national character sets:

US English      (using code page 437)
UK English      (using code page 437)
Canadian French (using code page 863)
French          (using code page 437)
French          (using code page 850)
German          (using code page 437)
German          (using code page 850)
Italian         (using code page 437)
Italian         (using code page 850)
Norwegian       (using code page 865)
Swedish         (using code page 437)
Swedish         (using code page 850)

If you need to use Reflection with any other national character set,
follow the instructions in this chapter for creating a translation
file. A translation file specifies how Reflection is to translate
between the character set in use on the PC and the host character
set.

After you've created a translation file, run the Reflection SETUP-R8
program. Choose Other in response to the Which language will you be
using? prompt. SETUP-R8 will prompt you for an input file. Type the name
of the translation file you have created. (Remember to supply full
path information if the file isn't in the current directory.)

SETUP-R8 compiles the translation file; the result is a binary file
named R8NCS.BIN. While this file is in the same directory as R8.EXE,
translations can occur.

CREATING A TRANSLATION FILE

If you need to create a translation file, you'll need to have tables
showing the numeric values (decimal or hexadecimal) for all 256
characters in both the EBCDIC character set running on your IBM
mainframe and the code page running on your PC.

It's only necessary to create a translation file if the following
conditions are both true:

-You're not using one of the languages supported by Reflection.

	This version of Reflection supports English, Swedish, German,
	French, Spanish, Italian, and Portuguese.

-No one else in your company has already created a translation file
for your language.

All users within a company running the same PC code page and
connecting to the same IBM mainframe can use copies of the same
translation file.

Translation files are text files without any special formatting. When
you create a translation file, you identify the code page running on
the PC (DOS uses the term code page to define a character set), and
specify exactly how the 256 characters in that code page should match
up to the 256 characters in EBCDIC, the character set used by IBM
hosts, when data moves between the two systems.

In a translation file, blank lines and lines that begin with
semi-colons are ignored. All information after a semi-colon on any
line is also ignored. Case is not significant--except for specifying
characters in a character set.

A typical translation file looks like this:

codepage 850

define ebcdic_disp = x'000c0d15191c1d1e293fff'
define ascii_disp  = x'20202020202a203b200220'

define nordic_ascii  = x'9b867c8f929db3aa91'
define nordic_ebcdic = x'4a5a6a5b7b8c4f5f7f'

a_to_e:
    table        = 0
    astd         = estd
    nordic_ascii = nordic_ebcdic

e_to_a:
    table         = '-'
    estd          = astd
    ebcdic_disp   = ascii_disp
    nordic_ebcdic = nordic_ascii

For additional translation files, see your Reflection disk--all files
with a .NCS extension are translation files.

There are three sections in a translation file: the line that
specifies the code page, an optional list of defines that identify a
set of characters or numbers, and the actual character mappings that
show how ASCII characters are translated into EBCDIC characters (for
sending data to the host), and how EBCDIC characters are translated
into ASCII characters (for receiving data from the host).

The following sections explain how to create the different parts of a
translation file.

CODE PAGE

The first line in a translation file identifies the code page DOS is
using. The format is:

codepage nnn

where nnn identifies the code page. As of DOS 5.0, there are six code
pages included with DOS: 437, 850, 852, 860, 863, and 865.

To find out which code page DOS is using, type chcp at the DOS
prompt.

If the code page specified in the translation file does not match the
code page DOS is using, the message "Code page error" will appear
when you try to start Reflection.

If you're running Reflection with a version of DOS prior to 3.3, the
code page line in the translation file is ignored.

If you don't want to specify a code page in the translation file, the
first line in the file should look like this:

codepage 0

Reflection will assume the current DOS code page.

DEFINES

Subsequent lines that begin with the word define identify groups of
characters. The syntax for these lines is:

define <identifier> = <string>

The identifier on the left side of the equal sign can be used later
in the file in place of the characters specified on the right side of
the equal sign. The identifier can contain any combination of
letters, numbers, and underscore characters (_), but must begin with
a letter.

The string on the right side of the equal sign can consist of any of
the following:

-hexadecimal numbers (00-ff)

If the string contains hexadecimal numbers, these numbers can
represent either ASCII (PC) or EBCDIC (host) characters--context will
determine which is relevant.

If the string contains hexadecimal numbers, it must be preceded by
the letter x and must be delimited by either single () or double
quotes ("). Hexadecimal numbers are always represented by two
characters, from 00 to ff. The individual numbers are not separated
by commas or spaces. The following example defines three hexadecimal
numbers (09, 14, and 1a) with the identifier ascii_ctl:

define ascii_ctl = x09141a

-a decimal number (0-255)

The string can contain only a single decimal number, which should not
be delimited by quotes. The number can represent either an ASCII or
an EBCDIC character-- context will determine which is relevant.

The following defines the decimal number 0 with the identifier null:

define null = 0

-one or more ASCII characters

If the string contains ASCII characters, it must be preceded by the
letter a and delimited by either single () or double quotes ("). The
individual characters in the string are not separated by commas or
spaces.

Only US uppercase and lowercase letters, numbers, and certain special
characters can be used--see the definition for ASTD.

The following example defines nine ASCII characters (seven blank
spaces, an asterisk, and a semi-colon) with the identifier
ascii_disp:

define ascii_disp = a'       *;'

If you need to map seven different EBCDIC characters to a single
ASCII character, you must have seven identical characters in the
ASCII string, like the seven blank spaces in the example, since the
nth character in one string is always translated to the nth character
in the other string . More on this in the next section.

-one or more EBCDIC characters

If the string contains EBCDIC characters, it must be preceded by the
letter e and must be delimited by either single (') or double quotes
("). The individual characters in the string are not separated by
commas or spaces.

Only US uppercase and lowercase letters, numbers, and certain special
characters can be used--see the definition for ESTD.

The following example defines nine EBCDIC characters (seven blank
spaces, an asterisk, and a semi- colon) with the identifier
ebcdic_disp:

define ebcdic_disp = e'       *;'

You cannot mix different kinds of strings in the same define (for
example, an ASCII string cannot also contain EBCDIC characters,
hexadecimal numbers, or a decimal number).

Several defines are built into Reflection:

TABLE          <designates all characters>

AUPPER         aABCDEFGHIJKLMNOPQRSTUVWXYZ
ALOWER         aabcdefghijklmnopqrstuvwxyz
ANUMBERS       a0123456789
ASPECIALS      a" &-/<*%()_+;>=,.:?"
ASTD           AUPPER + ALOWER + ANUMBERS + ASPECIALS
APT            x09
ANL            x0a
AFF            x0c
ACR            x0d
ASBA           x11
AEUA           x12
AIC            x13
ARA            x14
AEM            x19
ASUB           x1a
ADUP           x1c
ASF            x1d
AFM            x1e

EUPPER         eABCDEFGHIJKLMNOPQRSTUVWXYZ
ELOWER         eabcdefghijklmnopqrstuvwxyz
ENUMBERS       e0123456789
ESPECIALS      e" &-/<*%()_+;>=,.:?"
ESTD           EUPPER + ELOWER + ENUMBERS + ESPECIALS
EPT            x05
ENL            x15
EGE            x08
EFF            x0c
ECR            x0d
ESBA           x11
EEUA           x12
EIC            x13
ERA            x3c
EEM            x19
ESUB           x3f
EDUP           x1c
ESF            x1d
EFM            x1e
ESFE           x29
EMF            x2c
ESA            x28

CHARACTER MAPPINGS

The final section of a translation file specifies how ASCII
characters are to be translated into EBCDIC characters (for data
moving from the PC to the host) and how EBCDIC characters are to be
translated into ASCII characters (for data moving from the host to
the PC).

If you map the same character in a character set more than once (in
two separate lines), the last mapping is the one that is in effect.

The first two lines in this section must be:

a_to_e:
table = 0

The first line indicates that subsequent definitions cover
ASCII-to-EBCDIC translations; the second line initializes the
translation table.

Next come actual translations. The syntax for these translations is:

<string> = <string or character>

Strings can consist of one or more characters or a define.

If the item on the right side of the equal sign is a single
character, delimited by single or double quotes, then every character
on the left side of the equal sign is translated into that character
when data moves from the workstation to the host. For example, the
following line specifies that all 256 characters should be translated
to a dash:

table = '-'

The character can also be a decimal number:

table = 0

or hexadecimal number:

table = x'00'

If the item on the right side of the equal sign is a string, the
string on the left side of the equal sign must be the same length as
the string on the right, since the nth character in the left string
is translated into the nth character in the right string. Hexadecimal
numbers are two characters long, so in the following example both
strings are of equal length, even though there are twice as many
characters in the string on the left:

x'001d2915190c0d1c1e' = a'abcdefghi'

In the sample translation file shown on page 46 there are two lines
that specify ASCII to EBCDIC translations. Both use defines:

astd         = estd
nordic_ascii = nordic_ebcdic

The first line indicates that each character in astd (one of the
supplied defines for ASCII characters) should be translated into the
corresponding character in estd (one of the supplied defines for
EBCDIC characters) on transfers to the host.

The second line uses defines created earlier in the file.

After the last ASCII-to-EBCDIC line come the following two lines:

e_to_a:
table = '-'

The first of these lines indicates that subsequent definitions cover
EBCDIC-to-ASCII translations; the second line initializes the
translation table.

The remaining lines in the file specify EBCDIC-to-ASCII translations,
following the same conventions as for ASCII-to-EBCDIC translations.

******End of file*****
