|
|
National Language Support
When NeTraverse Merge is installed, it attempts to configure itself for
the same language (or locale) and keyboard as your UNIX system.
If this automatic configuration is not correct, refer to
``Setting up the NeTraverse Merge NLS environment''.
NeTraverse Merge national language support
NeTraverse Merge NLS includes the following features:
This appendix assumes you have some familiarity with DOS code pages. Refer to DOS documentation for more complete information on NLS-related DOS commands such as CHCP, COUNTRY, KEYB, MODE, and NLSFUNC.
DOS uses several different code pages to fill the needs of most Western European languages.
The UNIX operating system, on the other hand, uses only one code set, ISO 8859-1, to handle most Western European languages. NeTraverse Merge supports that code set. Other code set support could be added in the future.
If you use only DOS or only the UNIX system, you do not need to be aware of any differences between DOS code pages and UNIX code sets. When you use NeTraverse Merge to combine DOS and the UNIX system, however, you may notice some differences between the DOS and UNIX environments. Some characters in data and file names created with one operating system may be displayed as different characters when you view them with the other operating system. For example, suppose you have a DOS file called memo containing the following text:
This memo describes the features of our æNET product.If you issue the command
cat memo from the UNIX shell, the
words might be displayed like this:
This memo describes the features of our *NET product.Similar character conversions can occur when you view DOS text on different types of terminals. These character transformations occur because a code number represents each character. The same code number may exist in both your current DOS code page and UNIX code set, but it may be matched with a different symbol in each.
This appendix explains how to set up your DOS
and UNIX environments so you get the most
consistent behavior when you combine the DOS and
UNIX operating systems.
``Converting text files''
also describes the NeTraverse Merge
dos2unix, unix2dos, and charconv programs,
which you can use to convert text files in a variety of
different ways.
How DOS handles NLS
Different kinds of code pages
DOS recognizes two kinds of code pages.
A
hardware code page
is built into a hardware device.
A
software code page
is provided in software form and
stored in code page information (.cpi) files.
In the U.S., hardware devices commonly use code page 437 by default. Hardware devices designed for use in other countries use other code pages by default.
Not all devices can recognize all software code pages. Some printers, for instance, can print only the symbols contained in their hardware code pages. Thus, a particular character may be stored in the computer's memory as part of a software code page, but the attached printer may be unable to print that symbol correctly when it is sent. Some DOS monitors are limited in the characters they can display for the same reason. See ``Display considerations'' for further details.
Not all code pages and code sets are supported for every
operation. A particular character set may be viewable
on the console, for instance, but not viewable at an
attached terminal or printable by the printers
attached.
Code page switching
DOS allows you to work alternately in several languages on
the same machine by switching code pages.
You can work first in the characters
of one language, then switch code pages to work in
the characters of another language. Each device
affected must be prepared ahead of time with the
DOS MODE command. The actual switching is done
with the CHCP (change code page) command.
Tailoring DOS for different languages
The following list summarizes the procedures required to set
up a standard DOS computer for a different character set.
Refer to DOS documentation for more
complete information about following these
procedures on a conventional DOS computer.
Specific examples of these procedures as they apply
to the NeTraverse Merge environment appear later in this
appendix.
MODE device CODEPAGE PREPARE
in the autoexec.bat file.
This prepares code pages for those
devices that support code-page switching.
The UNIX
locale command
prints out the current NLS setup.
NeTraverse Merge uses the
LANG setting
to determine the language
and character set.
LANG is of the form:
LANG=language_territory.codeset
For instance,
LANG=fr_FR.8859-1 sets the
language to French as spoken in France,
and uses ISO Latin-1 (ISO 8859-1) as the character set.
All dates, times, and
currencies are expressed as is customary in that region.
NLS features of NeTraverse Merge
Display considerations
A VGA console can display any character set for which the
DOS font files are loaded.
The nature of your display, however, limits the availability of automatic
character conversion and the other NLS features offered by NeTraverse Merge.
The complete set of DOS NLS features is available run DOS on a VGA console, which lets DOS use the display as it would on a regular DOS PC. But normally with NeTraverse Merge you run DOS in a window on your X desktop, which uses X fonts to display characters. So the availability of X fonts for certain DOS code pages limits which DOS code can be fully used. When NeTraverse Merge is installed, at least the fonts for code sets 437 (U.S.) and 850 (Western European) are installed.
The DOS X font files that NeTraverse Merge installs are in the directory /usr/lib/merge/xc/fonts.
NeTraverse Merge automatically attempts to use the font that matches the current DOS codepage setting. When such a font is not installed a default font is used which might nor might not be suitable.
If you have them, you can install new DOS X fonts for NeTraverse Merge to use. This is done by naming the font according to this scheme: SSSSpcCCC where SSSS is the size ("6x13" for small and "8x14" for medium) and CCC is the code page number. So for example if you have a 8x14 font for DOS code page 861, the font should be installed as "8x14pc861".
Setting up the NeTraverse Merge NLS environment
NeTraverse Merge automatically configures the Windows NLS
environment settings based on your UNIX NLS settings and
the specific version of Windows that you install.
When you install Windows, the settings are placed in
the file $HOME/win/.boot/info.txt. In the rare occasions
that you need to adjust these settings, you can do so by
editing this file.
Usually a non US-English Windows installation will install a DOS keyb command in your personal autoexec.bat file. If it does not, and you need to configure a keyboard for your NeTraverse Merge DOS sessions, you can do so by:
If this automatic setting is not done correctly for your locale, you can override it by putting the setting you want in the UNIX WIN_LANG environment variable. (This is also the way to have different users on the same system use different LANG settings in their NeTraverse Merge sessions.) You can also make this the default for all users by putting this setting in the file "/etc/default/merge".
For example if in your DOS or Windows session you want to force the LANG setting to be "fr_CH" for all users you would put this line in "/etc/default/merge":
WIN_LANG=fr_CH
Windows keyboard setup
Each installation of Windows 95, 98 or Me needs to have the keyboard
configured. You do this the normal Windows way, and use Keyboard control
panel on a normal Windows machine.
WARNING:
When you are running a Windows session on an X windows display and Windows is set to use one of these "different" keyboard locales, NeTraverse Merge tries to keep the Caps-Lock state of Windows in agreement with the keyboard Caps-Lock indicator. But it can get out of sync if you press the shift key when Caps-Lock is on. So when the shift key is used when Caps-Lock is on, then Windows will have Caps-Lock go off while the keyboard indicator is still on. To recover, press the Caps-Lock key a few times, or focus on another X window, and then focus back to the Windows window.
NeTraverse Merge by default does not translate DOS text when you print. If the UNIX printer used for DOS printing does not support all the characters you send for printing, the results are unpredictable.
You cannot use the DOS MODE or
CHCP commands to
change the printer code page when you use a UNIX
printer. However, when you use the UNIX print
spooler, you can use the NeTraverse Merge
charconv
command to translate DOS text files before you print
them. For example, assume your DOS text file
memo
was created using DOS code page 850; you want
to print it using the UNIX ISO standard code set
(8859) and convert characters that do not exist in code
set 8859 to the best multibyte approximation. You
can convert memo using the command:
charconv /i pc850 /o 8859 /m /d memo memo.unx
You can then print the converted file using standard DOS or
UNIX commands (for example,
copy memo.unx lpt1).
You can also use the NeTraverse Merge printer command to change
the default UNIX print command that NeTraverse Merge
uses when you send DOS printer output to the UNIX
spooler. For example, if you want to use the
charconv command shown above whenever you print from
DOS, you can issue the following command at the
DOS prompt or in your
autoexec.bat file:
printer unix "charconv -i pc850 -o 8859 -m -d | lp"
After you issue this printer command, all text files you print from DOS are converted automatically.
Refer to ``Converting text files'' for more information on the charconv command. See ``Using the printer command'' in Chapter 6 for more information on the printer command.
You may also have to use special options for the UNIX "lp" (or "lpr") command you use to print the file. For example on OpenUNIX 8 or UnixWare 7 in Germany you use the "-L de" option to specify the German (de) locale, and you might need to use the "-D de" option for printing text files. The point is that the default printing configuration is likely to need various adjustments to properly print, and you will have to figure out these locale specific adjustments yourself.
Instead of using the UNIX print spooler, you can attach a
printer directly to your DOS process. When a printer
is directly attached to DOS, you can use the DOS
MODE or CHCP commands to change printer code
pages and use the printer in all other ways exactly as you
would with a conventional DOS computer. See
``Configuring printers for direct attachment''
in Chapter 5
for further information on setting up and using a
directly attached printer.
Converting text files
NeTraverse Merge has three commands that you can use to convert
text files so they are usable with different
code pages
and code sets:
dos2unix, unix2dos,
and charconv. You can use these commands both
in the DOS environment and at the UNIX shell prompt.
Using dos2unix and unix2dos
``Working with DOS and UNIX
files''
describes
how to use dos2unix and unix2dos
to convert text in
DOS format to UNIX format and UNIX to DOS format. In addition,
dos2unix and unix2dos by default translate
each character in your text from the DOS code page
to the corresponding character in the UNIX code set
or the reverse.
When you use these commands in the
DOS environment, NeTraverse Merge translates between
your current DOS code page and the UNIX code set
defined by the LANG locale setting. When
you use them at the UNIX shell, NeTraverse Merge
translates between the DOS code page defined by the
CODEPAGE environment variable and the UNIX
code set.
When all characters in your text file exist in both the code page and the code set, the converted output looks exactly the same as your original, unconverted text file (except that it is now usable with a different operating system). When your original text file contains characters that do not exist in both the code page and code set, dos2unix and unix2dos by default convert untranslatable characters into asterisks (*).
You can modify the behavior of
dos2unix and unix2dos by
using the same options that apply to the
charconv command, described in the next section.
Using charconv
The charconv command is a flexible and powerful text
conversion tool. charconv is most
useful in
multilanguage (NLS) environments. (For simple file
conversion cases, use
dos2unix and unix2dos.) Unlike
dos2unix or unix2dos,
charconv has no defaults for
code pages and code sets. The -i and -o options are
required unless you use the -x option.
The syntax of the charconv command is:
charconv [options] sourcefile
[targetfile]
The source and target files must not be the same. When
neither file parameter is specified,
charconv prints a
usage message to your screen. If you specify only one
file parameter, that file is considered the source file,
and the output is written to standard output.
charconv options
When issued from the UNIX command line,
charconv options
must be specified with a hyphen ( - ) rather than a
slash ( / ). In the DOS environment, you can use
either the slash or the hyphen. The examples in this
appendix show the hyphen, which will work in either
environment. You can use either uppercase or
lowercase options both from the UNIX shell and in
the DOS environment.
All of the options below can be set on the command line or with the CONVOPTS environment variable, which is described later.
-?-7-a-b-c x-d-i tbl-o tbl
For example, if you wanted to convert a DOS file from
code page 437 to code page 850, use the
charconv command as follows:
charconv -i pc437 -o pc850 sourcefile targetfile
-l-m-p-q-s-u-v-xWhen you specify -x, charconv does not allow you to use the -i or -o options.
-z^Z.
This option removes the end-of-file marker when
text is converted from DOS to UNIX. By default,
charconv converts the whole file.
charconv file name to accomplish a task.
For example, suppose you want to convert a series of files from code page 437 to code page 850 and make all of the characters uppercase.
If you use charconv in the DOS environment, set the
CONVOPTS environment variable on the DOS
command line as follows:
set convopts=/u /i pc437 /o pc850
If you use
charconv at the UNIX shell, define the
CONVOPTS variable as follows (this example assumes you use the
Bourne shell):
CONVOPTS="-u -ipc437 -opc850"; export
CONVOPTS
Now, you can just type the following line for each file:
charconv sourcefile targetfile
and charconv automatically converts from code page 437 to 850 and makes all characters uppercase.