Hardware code page: Difference between revisions

Content deleted Content added
improved refs
m Removed dead links.
Line 6:
 
==Code page assignments==
In North American [[IBM-compatible PC]]s, the hardware code page of the display adapter is typically [[code page 437]].<ref name="Elliott_2020_MDA"/> However, various portable machines<ref name="HP_1985_PP"/><ref name="HP_1986_PP"/><ref name="HP_1991_95LXUG"/> as well as (Eastern) European, Arabic, Middle Eastern and Asian PCs used a number of other code pages as their hardware code page,<ref name="Paul_2001_CPSwitchFD"/> including [[code page 100]] ("Hebrew"),<ref name="Paul_2002-09-05"/> [[code page 151|151]] ("Nafitha Arabic"),<ref name="Paul_2002-12-04"/> [[code page 667|667]] ("[[Mazovia encoding|Mazovia]]"),<ref name="Paul_2001_CPSwitchFD"/><ref name="Fujitsu_1994_DL6400_DL6600"/> [[code page 737|737]] ("Greek"), [[code page 850|850]] ("Multilingual"),<ref name="HP_1991_95LXUG"/><ref group="nb" name="NB_OmniGo_300"/> encodings like "[[HP Roman-8|Roman-8]]",<ref name="HP_1985_PP"/><ref name="HP_1986_PP"/> "[[Kamenický encoding|Kamenický]]",<ref name="Paul_2001_CPSwitchFD"/><ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1992_Flyer"/> "[[KOI-8]]", "[[MIK code page|MIK]]",<ref name="Fujitsu_1994_DL6400_DL6600"/> and others. Most display adapters support a single 8-bit hardware code page only.<ref name="Paul_2001_CPSwitchFD"/> The [[bitmap]]s were often stored in an [[EPROM]]<ref name="RBIL_61_INT15h_AX67C3h"/><ref name="Brown_2000_RBIL"/><ref name="Elliott_2020_MDA"/> in a [[DIP socket]].<ref name="Elliott_2020_MDA"/> At most, the hardware code page to be activated was user-selectable via [[jumper (computing)|jumper]]s,<ref name="Derfler_1985"/> configuration [[EEPROM]]s<ref name="HP_1985_PP"/><ref name="HP_1986_PP"/> or [[CMOS setup]].<ref name="HP_1996_200LXUG"/> However, some of the display adapters designed for Eastern European, Arabic and Hebrew PCs supported multiple software-''switchable'' hardware code pages, also named '''font pages''',<ref name="Paul_2001_CPSwitchFD"/> selectable via I/O ports<ref name="Elliott_2020_MDA"/> or additional BIOS functions.<ref name="RBIL_61_INT15h_AX67C3h"/><ref name="Brown_2000_RBIL"/>
 
In contrast to this, printers frequently support several user-switchable character sets, often including various variants of the 7-bit [[ISO/IEC 646]] character sets such as [[code page 367]] ("[[ISO/IEC 646-US]] / [[ASCII]]"<ref name="Paul_2001_CPSwitchFD"/>), sometimes also a couple of 8-bit code pages like [[code page 437]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1990_P90"/><ref name="Epson_1991_GQ"/> [[code page 850|850]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1990_P90"/><ref name="Epson_1991_GQ"/> [[code page 851|851]],<ref name="Fujitsu_1994_DL6400_DL6600"/> [[code page 852|852]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1993_EPROMs"/> [[code page 853|853]],<ref name="Epson_1992_EPL-4300"/> [[code page 855|855]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1993_EPROMs"/> [[code page 857|857]],<ref name="Epson_1992_EPL-4300"/> [[code page 860|860]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1990_P90"/><ref name="Epson_1991_GQ"/> [[code page 861|861]],<ref name="Epson_1991_GQ"/> [[code page 863|863]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1990_P90"/><ref name="Epson_1991_GQ"/> [[code page 865|865]],<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1990_P90"/><ref name="Epson_1991_GQ"/> and [[code page 866|866]].<ref name="Fujitsu_1994_DL6400_DL6600"/><ref name="NEC_1993_EPROMs"/><ref name="FreeBSD_2016_1"/><ref name="FreeBSD_2016_2"/> Printers for the Eastern European or Middle Eastern markets sometimes support other locale-specific hardware code pages to choose from. They can be selected via [[DIP switch]]es or configuration menus on the printer, or via specific [[escape sequence]]s.<ref name="Paul_2001_CPSwitchFD"/><ref group="nb" name="Escape_sequence_Epson_NEC"/>
Line 13:
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.<ref name="Paul_2001_CPSwitchFD"/><ref name="Caldera_1998_USER-9"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2001_NWDOSTIP"/>
 
Under [[DOS]] and [[Windows 9x]] this is accomplished by specifying the hardware code page as a parameter (hwcp) to the [[device driver]]s [[DISPLAY.SYS]] and [[PRINTER.SYS]] in [[CONFIG.SYS]]:
 
: <code>[[DEVICE (CONFIG.SYS directive)|DEVICE]]=…\DISPLAY.SYS CON=(type,hwcp,n|(n,m))</code><ref name="Paul_2001_CPSwitchFD"/><ref name="XyWrite_2009"/><ref name="Caldera_1998_USER-9"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2001_NWDOSTIP"/><ref name="Caldera_1998_USER-17"/><ref name="Prosise_1990"/>
Line 23:
: <code>DEVICE=…\PRINTER.SYS PRN=(type,(hwcp1,hwcp2,…),n)</code><ref name="Paul_2002-12-04"/>
 
If no hardware code page(s) are specified, these drivers default either to a dummy code page number 999<ref name="Paul_2001_CPSwitchFD"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2001_NWDOSTIP"/> 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<ref name="Paul_2001_COUNTRY"/> with the country code either specified in the CONFIG.SYS [[COUNTRY (CONFIG.SYS directive)|COUNTRY]] directive or assumed to be the operating system's internal default, usually 1 (US) in Western issues of DOS).<ref name="Paul_2001_CPSwitchFD"/>
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),<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2001_NWDOSTIP"/> 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.<ref name="Paul_2001_CPSwitchFD"/>
 
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 page]]s or 65280–65533 (FF00h–FFFDh) for [[private use code page]]s could be specified per [[IBM CDRA]] to give the operating system a non-conflictive "handle" to select that code page.
 
[[Arabic MS-DOS|Arabic]] and [[Hebrew MS-DOS]] do not use DISPLAY.SYS and PRINTER.SYS, but provide similar facilities using [[ARABIC.COM]], [[HEBREW.COM]], and [[<!-- Filename written with underscore: "SK_HGC.COM" -->SK{{text|_|HGC.COM}}]].<ref name="Paul_2002-12-04"/>
 
==OEM code pages==
Hardware code pages are also [[OEM code page]]s. The designation "OEM", for "[[original equipment manufacturer]]", indicates that the character set could be changed by the manufacturer to meet different markets.<ref name="Chen_2005_CP"/><ref name="Chen_2005_OEM"/>
 
However, OEM code pages do not necessarily reside in ROM, but include so called [[prepared code page]]spages,<ref name="XyWrite_2009"/><ref name="Caldera_1998_USER-17"/> (aka [[downloadable character set]]ssets<!-- aka "down-line loadable character set", term used by DEC --> or [[downloadable font]]s), character sets loaded as [[raster font]]s into the font RAM of suitable display adapters (like [[Sirius 1]]/[[Victor 9000]],<ref name="Sargent_1988_Sirius"/> [[NEC APC]],<ref name="NEC_1983_APC"/> [[HP 100LX]]/[[HP 200LX|200LX]]/[[HP OmniGo 700LX|700LX]],<ref name="HP_1996_200LXUG"/> [[Persyst]]'s [[Persyst BoB Color Adapter|BoB Color Adapter]],<ref name="Hart_1985"/> [[Hercules Computer Technology|Hercules]]' [[HGC+]],<ref name="Wilton_1987"/><ref name="Brown_2000_RBIL"/><ref name="Elliott_2012_HGCPlus"/> [[Hercules InColor Card|InColor]]<ref name="Wilton_1987"/><ref name="Elliott_2012_InColor"/> and [[Hercules Network Card Plus|Network Plus]]<ref name="CW_1988"/><ref name="Hercules_1988"/> with [[RAMFONT]], and IBM's [[Multi-Color Graphics Array|MCGA]],<ref name="Wilton_1987"/><ref name="Ferraro_1994"/><ref name="Brown_2000_RBIL"/> [[Enhanced Graphics Adapter|EGA]],<ref name="Ferraro_1994"/><ref name="Brown_2000_RBIL"/> [[VGA]],<ref name="Ferraro_1994"/><ref name="Brown_2000_RBIL"/> etc.) and printers as well.<ref name="Paul_2001_CPI"/><ref name="Elliott_2006_CPI"/><ref name="AEB_2001_CPI"/><ref name="Haralambous_2007_CPI"/><ref name="MS_1991_PR"/> Hence, the group of OEM code pages is a superset of hardware code pages.
 
==See also==
Line 56:
<ref name="Paul_1997_NWDOSTIP">{{cite book |title=NWDOS-TIPs &mdash; Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds |id=MPDOSTIP |author-first=Matthias R. |author-last=Paul |date=1997-07-30 |edition=3 |version=Release 157 |language=de |url=http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm |access-date=2012-01-11 |url-status=live |archive-url=https://web.archive.org/web/20160522014302/http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm |archive-date=2016-05-22}} (NB. NWDOSTIP.TXT is a comprehensive work on [[Novell DOS 7]] and [[OpenDOS 7.01]], including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)</ref>
<ref name="Paul_2001_NWDOSTIP">{{cite book |title=NWDOS-TIPs &mdash; Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds |id=MPDOSTIP |author-first=Matthias R. |author-last=Paul |date=2001-04-09 |edition=3 |version=Release 183 |language=de}}</ref>
<ref name="Paul_2001_CPSwitchFD">{{cite web |title=Changing codepages in FreeDOS |author-first=Matthias R. |author-last=Paul |date=2001-08-15 |access-date=2016-06-06 |url=http://www.freedos.org/technotes/technote/txt/141.txt |type=Technical design specification |url-status=dead |archive-url=https://web.archive.org/web/20160606182501/http://www.freedos.org/technotes/technote/txt/141.txt |archive-date=2016-06-06 |quote=[…] The […] active system codepage […] sometimes also called global codepage […] is the codepage currently in use for the [[DOS kernel]], for example the collating order and other [[I18N]] 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 using [[MODE (DOS command)|MODE]]). Further, in dealing with [[National Language Support|NLS]] issues, it is important to distinguish between the currently active, the hardware, and the [[primary code page|primary codepage]]scodepages 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 to [[Code page 437|437]] for the console, but some European clones have [[Code page 850|850]] stored in the video font ROMs, and I have been told that some Czech [[Color Graphics Adapter|CGA]] and [[Monochrome Display Adapter|MDA]] cards had [[Kamenický encoding|Kamenicky]] codepage 867 (aka [[Wordperfect]] codepage 895) stored in their ROMs. Most printers default to [[Code page 367|367]] ([[ISO-646-US]] 7-bit) or 437 on power up, and the default system, or global, codepage for the system is always 437 under [[DR-DOS]] […] but under [[MS-DOS]]/[[PC DOS]] it reflects the codepage entry in [[COUNTRY (CONFIG.SYS directive)|COUNTRY]]=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, the [[DOS 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 and [[NLSFUNC (DOS command)|NLSFUNC]], 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 Hebrew [[Hercules Graphics Card|HGC]] 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 and [[KEYBOARD.SYS]] contain only two codepage entries for a given country in Western issues of DOS. (In [[Arabic MS-DOS|Arabic]] and [[Hebrew MS-DOS|Hebrew]] issues there can be up to 8 codepages for one country […]) […] When you specify a line like: [[DEVICE (CONFIG.SYS directive)|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 code page|prepared codepage]]scodepages 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 [http://marc.info/?l=freedos-dev&m=99788711909602&w=2<!-- https://archive.today/20141001010931/http://marc.info/?l=freedos-dev&m=99788711909602&w=2 -->].)</ref>
<ref name="Paul_2002-09-05">{{cite web |title=Technical info on undocumented DOS country info for LCASE, ARAMODE and CCTORC records |author-first=Matthias R. |author-last=Paul |date=2002-09-05 |work=FreeDOS development list fd-dev at Topica |url=http://permalink.gmane.org/gmane.os.freedos.devel/364 |access-date=2016-05-26 |url-status=dead |archive-url=https://web.archive.org/web/20160527142512/http://permalink.gmane.org/gmane.os.freedos.devel/364 |archive-date=2016-05-27}}</ref>
<ref name="Paul_2002-12-04">{{cite web |title=DISPLAY CON |author-first=Matthias R. |author-last=Paul |date=2002-12-04 |work=FreeDOS development list freedos-dev |url=https://marc.info/?l=freedos-dev&m=103902610816421&w=2 |url-status=live |access-date=2016-06-07 |archive-url=https://archive.today/20170909221415/https://marc.info/?l=freedos-dev&m=103902610816421&w=2 |archive-date=2017-09-09}}</ref>