6.3 Code Pages

To display or print characters, MS-DOS uses code pages to translate character values into images. Each code page defines a set of 255 characters. The set includes language-specific and graphics characters in addition to the characters corresponding to keyboard keys.

At startup, MS-DOS uses the default code page, called the system code page (usually code page 437). A user can select a different code page by using the country command in the CONFIG.SYS file or by using the chcp command at the DOS prompt. A program can select a different code page by using Set Global Code Page (Interrupt 21h Function 6602h). This function is similar to the chcp command in that it changes the code page for the screen, keyboard, and printer, if these devices have been prepared for the new code page. Neither Set Global Code Page nor the chcp command can be used unless the Nlsfunc program is loaded.

A program can determine the active code page by using Get Global Code Page (Interrupt 21h Function 6601h). This function returns both the system code page and the code page set by the user or a program, if any.

For more information about code pages, see Appendix A, “Code Pages.”