National Language Support
The first part of this appendix is an overview of SCO Merge National Language Support (NLS). The second part has information for configuring the NLS features of SCO Merge.
When SCO 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 SCO Merge NLS environment''.
SCO Merge national language support
SCO 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 European languages.
The UNIX operating system, on the other hand, uses only one code set, ISO 8859-1, to handle most European languages. SCO Merge supports that code set.
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 SCO 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 SCO 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 SCO 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.
SCO 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 SCO Merge
Display considerations
A VGA console can display any character set for which the
font files are loaded. The nature of your display,
however, limits the availability of automatic
character conversion and the other NLS features
offered by SCO Merge.
The complete set of SCO Merge NLS features is available when you run DOS on an ISO terminal, on a VGA console, or in a VGA DOS environment from the Desktop.
Throughout this appendix, VGA display refers to a VGA console or to a VGA DOS environment on the Desktop. VGA session refers to a DOS session run on any of these displays.
Only a subset of SCO Merge NLS features is available when you use any of the following displays:
The same restrictions apply to standard ASCII terminals and
PC scancode terminals. In addition, there are some
DOS characters that cannot be displayed on ASCII
terminals. When you use DOS to display text
containing these characters, SCO Merge replaces
them with asterisks.
Setting up the SCO Merge NLS environment
SCO Merge automatically configures the DOS NLS
environment to match your UNIX NLS settings.
Because an exact match between DOS and UNIX NLS
environments is not possible, SCO Merge makes some assumptions
when creating your DOS NLS environment.
You can adjust these settings, if necessary,
by making changes to SCO Merge's
DOS NLS configuration data.
You can view or modify the current setting using the Locale Settings window of Merge Setup. You must be logged in as root to change NLS settings; otherwise, you can only view the current settings.
Follow these steps to access the Locale Setting window:
The current settings are shown. On the left is a list of Locales you can choose from, and on the right are the current NLS settings for Country, Codepage, and Keyboard:
The Keyboard setting that you pick from are the keyboard codes and identifiers that the DOS KEYB command uses. Some locales have several possible Keyboard settings. If you do not know the Keyboard setting to use, refer to your computer's documentation about the DOS KEYB command to use for your keyboard to work with DOS.
When SCO Merge is installed on a U.S. English system, or on a system for which it cannot automatically determine the UNIX NLS configuration, it is automatically configured for no DOS NLS support. In this case, the locale No Locale is highlighted, the Country and Codepage are zero, and there is no Keyboard setting.
Click OK to save any change you have made. If you change from No Locale to another setting, there will be a pause while SCO Merge rebuilds some files when you click OK. This process only takes a short time. New settings take effect for any new DOS or Windows sessions.
You can override these NLS settings by setting one or all of the UNIX environment variables COUNTRY, CODEPAGE, and KEYB. This way a user can have a different setting from the global setting. However, for this to work completely, the global setting cannot be No Locale.
The COUNTRY and KEYB variables are set to the same values shown in
the Locale Settings window for Country and Keyboard.
The CODEPAGE variable is set to the same value as the Codepage setting
but with the two letters pc in front. E.g., pc437.
WARNING:
When you are running a Windows 95 session on an X windows display and Windows 95 is set to use one of these "different" keyboard locales, Merge tries to keep the Caps-Lock state of Windows 95 in agreement with the keyboard Caps-Lock indicator. But it can only do this if you do not press the shift key when Caps-Lock is on. So when the shift key is used when Caps-Lock is on, then Windows 95 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 95 window.
SCO 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 SCO 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 SCO Merge printer command to change
the default UNIX print command that SCO 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.
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
SCO 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, SCO Merge translates between
your current DOS code page and the UNIX code set
defined by the LANG environment variable. When
you use them at the UNIX shell, SCO 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.
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.