SunPCi User's Guide

Using Code Pages in DOS

The following sections explain the basics of using code pages, including how to set up your system to support a particular character set. Also, several examples, using different hardware and prepared code pages, are provided. The examples show you how to manually set up your system to support national languages. It is assumed that all DOS files are in the directory \dos on drive C:.


Note –

You can also set up the code pages by using the KBCP environment variable with SunPCi, as described in Setting the KBCP Environment Variable.


Manually Setting the System Code Page

DOS uses the AUTOEXEC.BAT and CONFIG.SYS files to set up system code pages to support a national language. Examples of CONFIG.SYS commands are shown later in this chapter. Remember, when you change your CONFIG.SYS file, you must reboot the SunPCi window to enable the new settings.

To set up your system to support a character set, follow this procedure.

  1. In your CONFIG.SYS file, perform the following steps:

    1. Use the country configuration command to control country-specific characteristics such as the time format, date format, currency symbol, and character-sorting sequence.

    2. Use a device configuration command to tell DOS the hardware code page is a device and to allocate buffers for prepared code pages.

    3. Use an nlsfunc command to load the memory-resident national support functions. If you forget to issue the nlsfunc command, DOS will not allow you to specify code pages or keyboard codes.

  2. In your AUTOEXEC.BAT file, use the following commands:

    1. Use a mode cp prepare command to prepare code pages for each device that supports code-page switching.

    2. Use a keyb command to select the keyboard layout.

    3. Use a chcp command to select the code pages for all prepared devices. DOS automatically prepares two system code pages and selects the primary code page for your country. If you want to use the other code page prepared for your country, you can use the chcp command again.

Setting Country and Keyboard Codes

The first example uses only a hardware code page; code-page switching is not used. The commands tell DOS to accept the country information for France and load the French keyboard program. This example is similar in most European countries.

To the end of your CONFIG.SYS file, add the following line:


country=033,,c:\dos\country.sys 

To the AUTOEXEC.BAT file, add the following line:


keyb fr,,c:\dos\keyboard.sys 


Note –

The default AUTOEXEC.BAT file contains two lines at the end of the file that invoke AUTOEXEC.BAT files on the E: or H: drive. If your AUTOEXEC.BAT file still contains these lines, place the international command lines before them.


Using Hardware and Prepared Code Pages

The next example uses two code pages—one hardware and one prepared. In this instance, the system you are setting up uses the German code page provided in the EGA and the United States code page provided by DOS.

To the end of your CONFIG.SYS file, add the following on separate lines:


country=049,,c:\dos\country.sys
device=c:\dos\display.sys con:=(ega,437,1)
install=c:\dos\nlsfunc.exe c:\dos\country.sys

These CONFIG.SYS statements tell DOS that the hardware code page (437) in the Enhanced Graphics Adapter should be used, and that you are allocating space for one prepared code page. Also, they load memory-resident, national support functions.

To the end of your AUTOEXEC.BAT file, add the following exactly as shown (on separate lines):


mode con cp prep=((437)c:\dos\ega.cpi)
keyb gr,,c:\dos\keyboard.sys
chcp 437

These AUTOEXEC.BAT commands do the following: