When operating systems initialize their code page switching logic, they need to know but have no means to determine the previously active hardware code page by themselves. Therefore, for code page switching to work correctly, the hardware code page needs to be specified. Under
DOS and
Windows 9x this is accomplished by specifying the hardware code page as a parameter (hwcp) to the
device drivers DISPLAY.SYS and PRINTER.SYS in
CONFIG.SYS:
DEVICE=…\DISPLAY.SYS CON=(type,hwcp,n|(n,m)) DEVICE=…\PRINTER.SYS PRN=(type,hwcp,n) If multiple hardware code pages are supported in OEM issues, the first hardware code page (hwcp1) in the list specifies the default hardware code page: DEVICE=…\DISPLAY.SYS CON=(type,(hwcp1,hwcp2,…),n|(n,m)) DEVICE=…\PRINTER.SYS PRN=(type,(hwcp1,hwcp2,…),n) If no hardware code page(s) are specified, these drivers default either to a dummy code page number 999 or assume the hardware code page to be equal to the primary code page (the first code page listed in COUNTRY.SYS files for a particular country with the country code either specified in the CONFIG.SYS
COUNTRY directive or assumed to be the operating system's internal default, usually 1 (US) in Western issues of DOS). In many English-speaking countries, the primary code page is either 437 (f.e. in the US) or 850 (f.e. in the UK, Ireland and Canada), so that, without specifying a different code page, the system would often assume one of these to be the corresponding device's default hardware code page as well. If a hardware code page does not match one of those with official code page assignments, an arbitrary number from the range 57344–61439 (E000h–EFFFh) for
user-definable code pages or 65280–65533 (FF00h–FFFDh) for
private use code pages could be specified per
IBM CDRA to give the operating system a non-conflictive "handle" to select that code page.
Arabic and
Hebrew MS-DOS do not use DISPLAY.SYS and PRINTER.SYS, but provide similar facilities using ARABIC.COM, HEBREW.COM, and SK. ==OEM code pages==