Home > Commands A-M > Commands Ch-Cz

CHCP


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Displays the number of the active character set (code page). You can also use the CHCP command to change the active character set for all devices that support character set switching.

You must install the NLSFUNC program before you can use the CHCP command.

For an introduction to using character sets and the CHCP command, see the chapter "Customizing For International Use" in the MS-DOS User's Guide.

Tables of the character sets included with the operating system are shown in the appendix "Keyboard Layouts and Character Sets" in the MS-DOS User's Guide. For information about additional code pages included with MS-DOS v6.22, see COUNTRY.


Syntax

CHCP /?

CHCP [nnn]

Display the active character set number:

CHCP


Parameters
nnn (v3.30 Win95 NT3.5)
Specifies the prepared system character set defined by the COUNTRY command in the CONFIG.SYS file. By default, the operating system provides character sets for the following countries and languages:

Additional countries and languages are supported by the EGA2.CPI and EGA3.CPI files. For more information, see COUNTRY, which is located in the directory that contains your operating system files.


Switches
/? (NTXP)
Display help.

Related

For more information about character sets, see COUNTRY, NLSFUNC, and MODE (set device code pages) commands.
Equivalent Linux BASH commands:
LANG environment variable - Used to determine the locale category for any category not specifically selected with a variable starting with LC_.


Notes
Requirements for using the CHCP command

Before you can use the CHCP command, you must specify the location of the COUNTRY.SYS file by using the COUNTRY command and load the NLSFUNC program into memory.


Assigning a new character set

After you assign a new character set, any program you start uses that new character set. However, any program (not including COMMAND.COM) that you started before assigning the new character set will probably attempt to use the original character set.


Examples

To view the active character set setting command:

    CHCP

The operating system responds with a message similar to:

    Active code page: 437

To change the active character set to 850 (Multilingual):

    CHCP 850

The operating system alerts you if the specified character set has not been prepared for your system. The following error message appears:

    Invalid code page

If a device (monitor, keyboard, printer) is not prepared for a character set, the operating system displays an error message in the format:

    Code page 850 not prepared for device nnn

Errorlevels

none.


Availability
Internal
DOS
v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003