Code pages on the Windows OS


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. [ 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. [ Writing International Applications for Windows] ]


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. [ 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. [ [ Change Code Page Command] ] [ Microsoft DOS chcp command] ] [ How to change console font programmatically] ] [ 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

* [ Latin1]
* [ Writing International Applications for Windows]
* [ Windows Code Pages]
* [ OEM Code Pages]
* [ ISO Code Pages]
* [ Microsoft DOS chcp command]
* [ MultiByteToWideChar() Codepages CP_ACP/CP_OEMCP]
* [ Keep your eye on the code page]
* [ Code pages are really not enough]
* [ Why ACP != OEMCP (usually)]
* [;EN-US;Q247815 Necessary criteria for fonts to be available in a command window]
* [ How to change console font programmatically]
* [ Globalization Step-by-Step]
* [ Change Code Page Command]


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 = 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.