Command: chcp
CHCP displays or sets the active CODE PAGE number.
DISPLAY and NLSFUNC have to run to make CHCP work correctly.
See Examples.
Syntax:
CHCP [nnn] [/?]
Options:
nnn Specifies a CODE PAGE number.
Examples:
437 US
850 Multi (Latin I)
852 Slavic (Latin II)
860 Portuguese
863 Canadian-French
865 Nordic
/? Shows the help.
For more countries see: COUNTRY or COUNTRY.SYS
Comments:
Type CHCP without a parameter to display the active code page number.
Any program that started before the new code page was assigned may
continue to use the original code page. (This excludes COMMAND.COM,
which will be aware of code page changes.)
To use chcp:
1. specify the location of COUNTRY.SYS with the COUNTRY command.
2. load the NLSFUNC program.
3. use CHCP at any time to change the code page.
CHCP is a command internal to command.com and needs no other file
in order to work.
Examples:
This is an example for Bosnia Herzegovina. First of all goto COUNTRY
or COUNTRY.SYS to find the country number (387) and the codepages
that are available in this case (852, 850, 858, 855, 872). Then check
KPDOS to find out in which EGA package these languages are. In this
case the codepages 852, 850 and 858 are in EGA.CPX whereas 855 and
872 are in EGA3.CPX.
CONFIG.SYS / FDCONFIG.SYS:
!COUNTRY=387,852,C:\FREEDOS\BIN\country.sys
!LASTDRIVE=Z
!BUFFERS=20
!FILES=40
DOS=HIGH
DOS=UMB
DOSDATA=UMB
DEVICE=C:\FREEDOS\BIN\himemx.exe
DEVICEHIGH=C:\FREEDOS\BIN\jemm386.exe
SHELLHIGH=C:\FREEDOS\BIN\command.com C:\FREEDOS\BIN /E:1024
/P=C:\fdauto.bat
AUTOEXEC.BAT / FDAUTO.BAT:
path C:;C:\FREEDOS\,C:\FREEDOS\BIN
keyb yu
ctmouse
LH DISPLAY CON=(EGA,437,5)
MODE CON CP PREP=((852,850,858) C:\FREEDOS\CPI\EGA.CPX)
MODE CON CP PREP=(,,,855,872) C:\FREEDOS\CPI\EGA3.CPX
(,,, represents the presence of 852,850,858)
REM OR INSTEAD OF THE TWO LINES ABOVE (works slower, only
REM for demonstration purposes:
REM MODE CON CP PREP=((852) C:\FREEDOS\CPI\EGA.CPX)
REM MODE CON CP PREP=((,850) C:\FREEDOS\CPI\EGA.CPX)
REM MODE CON CP PREP=((,,858) C:\FREEDOS\CPI\EGA.CPX)
REM MODE CON CP PREP=((,,,855) C:\FREEDOS\CPI\EGA3.CPX)
REM MODE CON CP PREP=((,,,,872) C:\FREEDOS\CPI\EGA3.CPX)
REM Without commas the previous CP would be overwritten!
MODE CON CP SELECT=852 (should also work without this command)
LH NLSFUNC /Y C:\FREEDOS\BIN\country.sys
IN COMMAND LINE:
CHCP (Shows actual codepage, 852 in this example because
of setting in CONFIG.SYS)
CHCP 850 (changes to CP 850)
CHCP 858 (changes to CP 858)
CHCP 855 (changes to CP 855)
CHCP 872 (changes to CP 872)
CHCP 857 gives an error message (CP is not prepared!)
For an alternative example see NLSFUNC.
See also:
command.com/freecom
country (COUNTRY NUMBERS)
country.sys (COUNTRY NUMBERS)
cpidos
device/devicehigh
display
graftabl
keyb
kpdos
mode
nlsfunc
Copyright © 2004 Robert Platt, updated 2011 and 2022 by W. Spiegl.
This file is derived from the FreeDOS Spec Command HOWTO.
See the file H2Cpying for copying conditions.