Windows code page

来源:互联网 发布:店老大软件 编辑:程序博客网 时间:2024/04/29 20:08

source:http://en.wikipedia.org/wiki/Windows_code_pages

Windows code page

From Wikipedia, the free encyclopedia

  (Redirected from Windows code pages)
Jump to: navigation, search

Windows code pages are sets of characters or code pages (known as character encodings in other operating systems) used in Microsoft Windows systems from the 1980s and 1990s.

Contents

[hide]
  • 1 Overview
  • 2 History
  • 3 List
  • 4 Problems of code pages
  • 5 References
  • 6 External links

[edit] Overview

There are two groups of code pages used in pre-Windows NT systems, which are sometimes referred as Windows code pages: OEM and ANSI code pages. The OEM code pages are used in console windows of these systems and can be considered a holdover from DOS and the original IBM PC architecture. The ANSIcode pages (sometimes simply called "Windows code pages", as the OEMcode pages are more related to DOS) are extended versions of thenational or international standard sets, used for non-Unicode applications using the GUI of these systems. Both OEM and ANSI code pages are extended ASCII code pages.

ANSI Windows code pages, and especially the code page 1252, are called that way since they were purportedly based on drafts submitted or intended for ANSI. However, ANSI and ISO have not standardized any of these code pages. Instead they are either supersets of the standard sets such as those of ISO 8859and the various national standards (like Windows-1252 vs. ISO-8859-1),major modifications of these (making them incompatible to variousdegrees, like Windows-1250 vs. ISO-8859-2) or having no parallelencoding (like Windows-1257 vs. ISO-8859-4; ISO-8859-13 was introducedmuch later).[1]

Two single-byte, fixed-width code pages (874 for Thai and 1258 for Vietnamese) and four multibyte CJK code pages (932, 936, 949, 950) are used as both OEM and ANSI code pages. Code page 1258 uses combining diacritics, as Vietnamese requires more than 128 letter-diacritic combinations. This is in contrast to VISCII, which replaces some of the C0 control codes.

[edit] History

Initially, computer systems and system programming languages did notmake a distinction between characters and bytes. This led to muchconfusion subsequently. Microsoft software and systems previous to the Windows NT line are examples of this, using the OEM and ANSI code pages, which do not make the distinction.

Since the late 1990s, software and systems are increasingly adopting more direct encodings of Unicode, in particular UTF-8 and UTF-16; this trend has been improved by the widespread adoption of XML, which provides a more adequate mechanism for labelling the encoding used. Recent Microsoft products and application program interfaces use Unicode internally, but many applications and APIs continue to use the default encoding of the computer's localewhen reading and writing text data to files or standard output.Therefore, though Unicode is the accepted standard, there is stillbackwards compatibility with the older Windows code pages.

The euro sign is a recent addition to ANSI code pages, and certain fonts may not display it.

[edit] List

The following Windows code pages exist:

  • 874 — Thai
  • 1250 — East European Latin
  • 1251 — Cyrillic
  • 1252 — West European Latin
  • 1253 — Greek
  • 1254 — Turkish
  • 1255 — Hebrew
  • 1256 — Arabic
  • 1257 — Baltic
  • 1258 — Vietnamese

[edit] Problems of code pages

Microsoft strongly recommends using Unicode in modern applications,but many applications or data files still depend on the legacy codepages. This can cause many problems:

  • The code page for a system differs between machines, so files created on one machine may become unreadable on another.
  • Data is often improperly tagged with the code page name or id, ornot tagged at all, making determination of the correct code page toread the data difficult or impossible.
  • These Microsoft code pages differ to various degrees from some ofthe standards and other vendors' implementations. This isn't aMicrosoft issue per-se as it happens to all vendors, but the lack ofconsistency makes interoperability with other systems unreliable insome cases
  • Code pages generally only encode a small fraction of the dataavailable on the computer natively. Proper use of Unicode allowsaccurate representation of all of the data on the machine.[clarification needed]
  • Data expressed in an unknown code page may be converted to ???????? or worse, but can correctly round trip in Unicode.[clarification needed]

[edit] References

  1. ^ Microsoft Glossary

[edit] External links

  • Code page information from Microsoft.
  • Blog about Microsoft code pages.
  • Windows Code Page reference chart
  • IANA Charset Name Registrations
  • Unicode mapping table for Windows code pages
  • Unicode mappings of windows code pages with "best fit"