Code pages on the Windows OS

=History=

A code page is a mapping between values stored in memory and the symbols they represent. On MS-DOS systems (prior to Windows) the code page was what today is called the OEM code page. At the time, the common code page (Code page 437) contained many box-drawing characters which were used to simulate a GUI in MS-DOS. It did not contain sufficient accented letters to support many European languages. [http://blogs.msdn.com/oldnewthing/archive/2005/03/08/389527.aspx Keep your eye on the code page] ]

With the advent of Windows, it was decided that a new code page with those box-drawing characters replaced by accented letters was required (Windows-1252). However, since most existing applications were MS-DOS and might depend on cp437, the existing code page could not be replaced. Hence, the concept of ANSI code pages and OEM code pages was created. ANSI code pages are used by Windows and its applications. Despite its name, ANSI code pages are not endorsed by the American National Standards Institute. OEM code pages are used by MS-DOS. [http://support.microsoft.com/kb/q65124 Writing International Applications for Windows] ]

Use

The default OEM code page can be changed by changing the system wide locale and rebooting. This also changes the raster font available to the console. [http://www.microsoft.com/globaldev/getwr/steps/WRG_lclmdl.mspx Globalization Step-by-Step] ] The active OEM code page can be changed by the MS-DOS chcp command, but this will not display correctly unless you switch from the default raster font to Lucida Console. Raster fonts do not support non-system-wide changing of the code page. [ [http://support.microsoft.com/kb/q191309 Change Code Page Command] ] [http://www.computerhope.com/chcphlp.htm Microsoft DOS chcp command] ] [http://www.kpym.com/blog/2005/11/console-howto-change-console-font.html How to change console font programmatically] ] [http://www.aggressivesoftware.com/misc/latin1/ Latin1] ]

Windows alt codes can be used to input characters from the OEM or ANSI code pages. This is useful for the characters that not available on your keyboard. However, when using MS-DOS, if a character requested from the ANSI code page does not exist in the OEM code page, then a best-fit translation automatically occurs. When using a raster font, the result of the best-fit translation is displayed. When using Lucida Console, the character prior to the best-fit translation is displayed, but the translated byte is actually received by the application. Hence, using the ANSI alt codes in MS-DOS is error prone when the OEM code page does not support all characters in the ANSI code page.

Prior to Windows Vista, the active console code page can be changed programatically, but the console font cannot. So if the console is in the default configuration (using raster fonts), then programatic changing of the code page is not useful for console applications because incorrect characters will be displayed to the user.

See also

* Code page 437
* Code page 850
* Windows-1252
* Alt code

External links

* [http://www.aggressivesoftware.com/misc/latin1/ Latin1]
* [http://support.microsoft.com/kb/q65124 Writing International Applications for Windows]
* [http://www.microsoft.com/globaldev/reference/wincp.mspx Windows Code Pages]
* [http://www.microsoft.com/globaldev/reference/oem.mspx OEM Code Pages]
* [http://www.microsoft.com/globaldev/reference/iso.mspx ISO Code Pages]
* [http://www.computerhope.com/chcphlp.htm Microsoft DOS chcp command]
* [http://support.microsoft.com/kb/108450 MultiByteToWideChar() Codepages CP_ACP/CP_OEMCP]
* [http://blogs.msdn.com/oldnewthing/archive/2005/03/08/389527.aspx Keep your eye on the code page]
* [http://blogs.msdn.com/michkap/archive/2005/03/01/382289.aspx Code pages are really not enough]
* [http://blogs.msdn.com/michkap/archive/2005/02/08/369197.aspx Why ACP != OEMCP (usually)]
* [http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q247815 Necessary criteria for fonts to be available in a command window]
* [http://www.kpym.com/blog/2005/11/console-howto-change-console-font.html How to change console font programmatically]
* [http://www.microsoft.com/globaldev/getwr/steps/WRG_lclmdl.mspx Globalization Step-by-Step]
* [http://support.microsoft.com/kb/q191309 Change Code Page Command]

References


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Code page — is another term for character encoding. It consists of a table of values that describes the character set for a particular language. The term code page originated from IBM s EBCDIC based mainframe systems,[1] but many vendors use this term… …   Wikipedia

  • Windows-1252 — Windows 1252, sometimes called incorrectly ANSI . Blue dots indicate unused or control characters Windows 1252 or CP 1252 is a character encoding of the Latin alphabet, used by default in the legacy components of Microsoft Windows in English and… …   Wikipedia

  • Windows 2000 — Part of the Microsoft Windows family Screenshot of Windows 2000 Professional …   Wikipedia

  • Windows-1258 — is a codepage used in Microsoft Windows to represent Vietnamese texts. It makes use of combining diacritical marks. Windows 1258 is not compatible with VISCII. It is very similar to windows 1252 with the differences being that s caron and z caron …   Wikipedia

  • Windows-1251 — (a.k.a. code page CP1251) is a popular 8 bit character encoding, designed to cover languages that use the Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages. It is the most widely used for encoding the Bulgarian,… …   Wikipedia

  • Windows 98 — Part of the Microsoft Windows family …   Wikipedia

  • Windows Media Player — A component of Microsoft Windows Details …   Wikipedia

  • The Book of Mozilla — is a computer Easter egg found in the Netscape and Mozilla series of web browsers. [cite news url = http://query.nytimes.com/gst/fullpage.html?res=980CE0D7163DF93AA35757C0A96E958260 n=Top/Reference/Times%20Topics/People/S/Slatalla,%20Michelle… …   Wikipedia

  • The Master and Margarita —   …   Wikipedia

  • Windows Explorer — This article is about the Windows file system browser. For the similarly named web browser, see Internet Explorer Windows Explorer A component of Microsoft Windows Details Included with Microsoft Windows …   Wikipedia

  • Windows NT — Not to be confused with Windows NT 4.0. Windows NT Company / developer Microsoft Programmed in C, C++ and Assembly language …   Wikipedia


Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”

We are using cookies for the best presentation of our site. Continuing to use this site, you agree with this.