In computing, ahardware code page (HWCP) refers to acode page supported natively by a hardware device such as adisplay adapter orprinter. Theglyphs to present the characters are stored in thealphanumeric character generator's resident read-only memory (likeROM or flash) and are thus not user-changeable.[1][2][3] They are available for use by the system without having to load anyfont definitions into the device first. Startup messages issued by aPC'sSystem BIOS or displayed by anoperating system before initializing its own code page switching logic and font management and before switching tographics mode are displayed in a computer'sdefault hardware code page.
In North AmericanIBM-compatible PCs, the hardware code page of the display adapter is typicallycode page 437.[4] However, various portable machines[5][6][7] as well as (Eastern) European, Arabic, Middle Eastern and Asian PCs used a number of other code pages as their hardware code page,[1] including code page 100 ("Hebrew"),[8] 151 ("Nafitha Arabic"),[9]667 ("Mazovia"),[1][10]737 ("Greek"),850 ("Multilingual"),[7][nb 1] encodings like "Roman-8",[5][6] "Kamenický",[1][10][11] "KOI-8", "MIK",[10] and others. Most display adapters support a single 8-bit hardware code page only.[1] Thebitmaps were often stored in anEPROM[12][13][4] in aDIP socket.[4] At most, the hardware code page to be activated was user-selectable viajumpers,[14] configurationEEPROMs[5][6] orCMOS setup.[15] However, some of the display adapters designed for Eastern European, Arabic and Hebrew PCs supported multiple software-switchable hardware code pages, also namedfont pages,[1] selectable via I/O ports[4] or additional BIOS functions.[12][13]
In contrast to this, printers frequently support several user-switchable character sets, often including various variants of the 7-bitISO/IEC 646 character sets such ascode page 367 ("ISO/IEC 646-US /ASCII"[1]), sometimes also a couple of 8-bit code pages likecode page 437,[10][16][17]850,[10][16][17] 851,[10]852,[10][18] 853,[19] 855,[10][18] 857,[19] 860,[10][16][17]861,[17]863,[10][16][17]865,[10][16][17] and866.[10][18][20][21] Printers for the Eastern European or Middle Eastern markets sometimes support other locale-specific hardware code pages to choose from. They can be selected viaDIP switches or configuration menus on the printer, or via specificescape sequences.[1][nb 2]
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.[1][22][23][24]
UnderDOS andWindows 9x this is accomplished by specifying the hardware code page as a parameter (hwcp) to thedevice drivers DISPLAY.SYS and PRINTER.SYS inCONFIG.SYS:
DEVICE=…\DISPLAY.SYS CON=(type,hwcp,n|(n,m))[1][2][22][23][24][25][26]DEVICE=…\PRINTER.SYS PRN=(type,hwcp,n)[1][22][23][24][25][26]
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))[9]DEVICE=…\PRINTER.SYS PRN=(type,(hwcp1,hwcp2,…),n)[9]
If no hardware code page(s) are specified, these drivers default either to a dummy code page number 999[1][23][24] 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[27] with the country code either specified in the CONFIG.SYSCOUNTRY directive or assumed to be the operating system's internal default, usually 1 (US) in Western issues of DOS).[1]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),[23][24] 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.[1]
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) foruser-definable code pages or 65280–65533 (FF00h–FFFDh) forprivate use code pages could be specified perIBM CDRA to give the operating system a non-conflictive "handle" to select that code page.
Arabic andHebrew MS-DOS do not use DISPLAY.SYS and PRINTER.SYS, but provide similar facilities using ARABIC.COM, HEBREW.COM, and SK_HGC.COM.[9]
Hardware code pages are alsoOEM code pages. The designation "OEM", for "original equipment manufacturer", indicates that the character set could be changed by the manufacturer to meet different markets.[28][29]
However, OEM code pages do not necessarily reside in ROM, but include so called prepared code pages,[2][25] (aka downloadable character sets ordownloadable fonts), character sets loaded asraster fonts into the font RAM of suitable display adapters (likeSirius 1/Victor 9000,[30]NEC APC,[31]HP 100LX/200LX/700LX,[15]Persyst'sBoB Color Adapter,[32]Hercules'HGC+,[33][13][34]InColor[33][35] andNetwork Plus[36][37] withRAMFONT, and IBM'sMCGA,[33][38][13]EGA,[38][13]VGA,[38][13] etc.) and printers as well.[39][40][41][42][43] Hence, the group of OEM code pages is a superset of hardware code pages.
ESC R (n) with (n) = 0..254 being a code associated with specific character sets. The range of supported codes depends on the printer model and installed font options.[…] The […] active system codepage […] sometimes also called global codepage […] is the codepage currently in use for theDOS kernel, for example the collating order and otherI18N tables depend on this codepage. While in most cases the system codepage reflects the codepage used for devices such as console (DISPLAY.SYS), printers (PRINTER.SYS), and keyboard (KEYB.COM), this is not a requirement as there are means to switch the individual device codepages without changing the system codepage (for example usingMODE). Further, in dealing withNLS issues, it is important to distinguish between the currently active, the hardware, and the primary codepages for any device and/or the system. The hardware codepage is the default codepage supported by a device after initialization of the hardware. It normally defaults to437 for the console, but some European clones have850 stored in the video font ROMs, and I have been told that some CzechCGA andMDA cards hadKamenicky codepage 867 (akaWordperfect codepage 895) stored in their ROMs. Most printers default to367 (ISO-646-US 7-bit) or 437 on power up, and the default system, or global, codepage for the system is always 437 underDR-DOS […] but underMS-DOS/PC DOS it reflects the codepage entry inCOUNTRY=country,codepage,filespec where it must be one of the codepages valid for the given country as per COUNTRY.SYS filespec - this is 437 (or 850 on newer systems) in most cases, but not necessarily. The default country is 1 (USA), the default filespec is "\COUNTRY.SYS", and if no filespec is found the system will work with the statically pre-initialized data in the kernel which is the data for the USA in most cases. If no codepage is given with COUNTRY, theDOS BIOS will search for the first codepage entry for a given country (or 1), this is called the primary codepage. The codepage value of 0 is used internally to retrieve this codepage, and for the COUNTRY.SYS file parsers in the DOS BIOS andNLSFUNC, a codepage value of zero means "match any codepage, whatever comes first for the given country code". So, it depends on the order of codepage entries in the COUNTRY.SYS file if the system will default to 437, 850, or something else. […] However, some Arabic and HebrewHGC and CGA cards have multiple hardware fonts, so called fontpages, […] so that a device may support multiple hardware codepages at the same time. The corresponding fontpage functions are INT 2Fh/AD41h and INT 2Fh/AD42h. […] COUNTRY.SYS andKEYBOARD.SYS contain only two codepage entries for a given country in Western issues of DOS. (InArabic andHebrew issues there can be up to 8 codepages for one country […]) […] When you specify a line like:DEVICE=…\display.sys con=(ega,437,1) […] DISPLAY.SYS is told that 437 should be assumed to be the hardware codepage of the display adapter. This is necessary to be known by DISPLAY.SYS because it will use different mechanisms to switch to the software prepared codepages and the hardware codepage, and there is no way to retrieve the info about the hardware codepage by itself. When the requested codepage is equal to the hardware codepage declared here, DISPLAY.SYS will use the method to switch to the hardware codepage, otherwise it will attempt to look up the font info in its internal buffer. […](NB. Based on fd-dev post[1].)
[…] Reading from port 03BAh returns vertical sync in bit 7, and a card ID in bits 6-4: 000: Hercules, 001: Hercules Plus, 101: Hercules InColor, 111: Unknown clone […] One card […] which appears to be a Hercules clone of Eastern European origin, has a further capability - two ROM fonts, selectable in software. These options are controlled in a similar manner to other extended features in the Hercules: Bit 2 of port 3BFh must be set to enable the feature, and then Bit 4 of port 3B8h selects which font to use. The card ID in bits 6-4 of port 03BAh has all three bits set. […]
TheHP 95LX character set is equivalent tocode page 850, theIBM PC multilingual character set. (Note that your HP 95LX containsMS-DOS 3.22, which does not supportcode-page switching.) All the HP 95LX applications use this set except1-2-3, which usesLICS, theLotus International Character Set. Most LICS characters are included in code page 850; the few that are not will not display […] If your HP 95LX cannot display […] or if your printer cannot print a LICS character, the HP 95LX uses a fallback presentation for that character […] if you use the© symbol and your printer cannot print it, the HP 95LX might display(c) orc as the fallback presentation (depending on the capabilities of your printer).
Your palmtop supportscode pages 850 and437. The built-in applications (except1-2-3) andSystem Manager-compliant applications […] use code page 850. […] Any DOS application you load and run will by default use code page 437. If an application requires code page 850, you can select it using the Setup utility.