Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Code page 932 (Microsoft Windows)

From Wikipedia, the free encyclopedia
Windows character set for Japanese
This article is about Microsoft's Code Page 932 and IBM's Code Page 943. For IBM's Code Page 932, seeCode page 932 (IBM).
"Windows-31J" redirects here. For the operating system version, seeWindows 3.1J.
Windows Code page 932
MIME / IANAWindows-31J
Alias(es)CP943C
LanguageJapanese
StandardWHATWG Encoding Standard (as "Shift_JIS")[1]
ClassificationExtended ASCII,[a]variable-width encoding,CJK encoding
ExtendsShift_JIS
  1. ^Not in the strictest sense of the term, as ASCII bytes can appear as trail bytes.

Microsoft Windows code page 932 (abbreviatedMS932,[2][3]Windows-932[3] or ambiguouslyCP932[4]), also calledWindows-31J amongst other names (see§ Terminology below), is theMicrosoft Windowscode page for theJapanese language, which is an extended variant of theShift JIS Japanesecharacter encoding. It contains standard 7-bitASCII codes, and Japanese characters are indicated by the high bit of the first byte being set to 1. Some code points in this page require a second byte, so characters use either 8 or 16 bits for encoding.

IBM offer the same extended double-byte codes in theircode page 943 (IBM-943 orCP943),[5] which is a combination of the single-byteCode page 897 and the double-byteCode page 941.[6]

Windows-31J is the most used non-UTF-8/Unicode Japanese encoding on the web. However, many people and software packages, including Microsoft libraries,[7] declare theShift JIS encoding for Windows-31J data, although it includes some additional characters, and some of the existing characters are mapped toUnicode differently. This has led the WHATWG HTML standard to treat the encoding labelsshift_jis andwindows-31j interchangeably, and use the Windows variant for its "Shift_JIS" encoder and decoder.[1]

Terminology

[edit]

Microsoft's Shift JIS variant is known simply as "Code page 932" on Microsoft Windows, however this is ambiguous asIBM's code page 932, while also a Shift JIS variant, lacks the NEC and NEC-selected double-byte vendor extensions which are present in Microsoft's variant (although both include the IBM extensions) and preserves the 1978 ordering of JIS X 0208.[5]

IBM's code page 943 (or "IBM-943") includes the same double byte codes as Windows code page 932.[5] Microsoft's version corresponds closely to the encoding referred to asibm-943_P15A-2003 (with aliases includingCP943C andWindows-932)[3] inInternational Components for Unicode (ICU). There is also a second ICU encoding namedibm-943_P130-1999,[8] which uses different single-byte mappings which more closely match IBM's code page definitions. (See§ Single-byte character differences below for details.)

Windows code page 932 is registered with theIANA asWindows-31J.[9] The "Windows-31J" label is IANA's and not recognized by Microsoft, which has historically used "shift_jis" instead.[7] TheW3C/WHATWG encoding standard used byHTML5 treats the label "shift_jis" interchangeably with "windows-31j" with the intent of being "compatible with deployed content"[10] and matches Windows code page 932[1] (including the "formerly proprietary extensions from IBM and NEC").[11]

Windows code page 932 is also calledMS_Kanji,[3][12] although IANA treat MS_Kanji as an alias for standard Shift JIS.[9]Python, for example, uses the labelMS-Kanji (orcp932) for Windows-932 and the labelShift_JIS (orsjis) for JIS X 0208-defined Shift JIS, without recognising theWindows-31J label.[12]

In Japanese editions of Windows, this code page isreferred to as "ANSI", since it is the operating system's default 8-bit encoding, even thoughANSI was not involved in its definition.

Differences from standard Shift JIS

[edit]

Windows-31J is often mistaken for standard Shift JIS (as defined inJIS X 0208:1997 Appendix 1): while similar, the distinction is significant for computer programmers wishing to avoidmojibake.

Double-byte character differences

[edit]
Euler diagram comparing repertoires ofJIS X 0208,JIS X 0212,JIS X 0213, Windows-31J, the Microsoft standard repertoire andUnicode

In addition to the standardJIS X 0201:1997 andJIS X 0208:1997 characters, Windows-31J includes several JIS X 0208 extensions, namely "NEC special characters (Row 13), NEC selection of IBM extensions (Rows 89 to 92), and IBM extensions (Rows 115 to 119)",[9] in addition to setting some encoding space aside forend user definition.[13] This also differs fromIBM-932, which does not include the NEC extensions or NEC selection.[5]

The IBM extensions were designed to encode characters from theIBM Japanese DBCS-Host repertoire which were initially absent in JIS X 0208; the'because' sign ∵ and'not' sign ¬ were later added to JIS X 0208 itself in 1983, and Microsoft includes them at extension locations as well as their 1983 locations.[14] The NEC extensions also encode the entirety of the IBM repertoire, but in a separate extension within the 94×94 JIS X 0208 grid (in rows 89–92, besides the characters already included inNEC row 13), rather than using Shift JIS codes beyond the JIS X 0208 range; Windows code page 932 includes these 388 characters in both locations.[14] As a result, the 'because' and 'not' signs are encoded three times.

Some of these representations were subsequently used for different characters byJIS X 0213 andShift JIS-2004. For example, compare row 89 in JIS X 0213 (beginning 硃, 硎, 硏…)[15] to row 89 as used by JIS X 0208 with IBM/NEC extensions (beginning 纊, 褜, 鍈…).[16] Consequently, Shift JIS-2004 is not compatible with Windows-31J.

In addition to the above, Microsoft uses different (but visually similar) Unicode mapping for several double-byte punctuation characters compared to standard Shift JIS, such as thewave dash beingmapped to U+FF5E rather than U+301C,[17] which is followed by ibm-943_P15A-2003[18] but not ibm-943_P130-1999,[19] and using different mapping for the double byte backslash.[17]

Single-byte character differences

[edit]

Windows-932 includes standard 7-bitASCII mappings for single-byte sequences with the high bit set to 0. Hence, codes 0x5C and 0x7E are mapped to Unicode as U+005C REVERSE SOLIDUS (\, thebackslash) and U+007ETILDE (~) respectively,[20][21][17] as they are in ASCII (ISO-646-US). This is likewise done by the W3C/WHATWG encoding standard.[22] By contrast, 0x5C is mapped to U+00A5YEN SIGN (¥) inISO-646-JP and consequentlyJIS X 0201, of which standardShift JIS is an extension. Correspondingly, Windows-31J avoids duplicate encoding of the backslash by mapping the double byte 0x815F to U+FF3C FULLWIDTH REVERSE SOLIDUS, whereas standard Shift JIS maps it to U+005C.[17]

However, 0x5C in Windows-932 is nonetheless considered a Yen sign in certain contexts.[23] For this reason, in many Japanese fonts, U+005C is displayed as a Yen symbol, which would normally be represented as U+00A5, rather than as a backslash per Unicode's suggested rendering. U+00A5 is one-way best-fit mapped onto 0x5C in Windows-932. However, code 0x5C in Windows-932 behaves as a reverse solidus (backslash) in all respects (e.g. infile paths on Windows systems) other than how it is displayed by some fonts,[23] and Microsoft's documentation for Windows-932 displays 0x5C as a backslash.[21] This mapping[20] corresponds to the encoding named "ibm-943_P15A-2003" inInternational Components for Unicode (ICU),[3] except for minor reordering of a fewC0 control characters.

IBM-943, likeIBM-932,[5] is a superset of the single-byteCode page 897,[6] which maps 0x5C to the Yen symbol (¥) and 0x7E to the overline (),[24] this is followed by the encoding named "ibm-943_P130-1999" in ICU.[8] Code page 897 (and therefore also IBM-943 and IBM-932) also adds single-byte box-drawing characters replacing certainC0 control characters,[24] however these may still be treated as control characters depending on the context,[25] and are mapped to control characters in ICU.[8]

Layout

[edit]
First byte
0123456789ABCDEF
0
1
2!"#$%&'()*+,-./
30123456789:;<=>?
4@ABCDEFGHIJKLMNO
5PQRSTUVWXYZ[\]^_
6`abcdefghijklmno
7pqrstuvwxyz{|}~
8
9
A
Bソ
C
D
E
F
Second byte
0123456789ABCDEF
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
 
Non printable ASCII character
ASCII character
ASCII character, may be substituted by localized fonts
Single-byte half-width katakana
First byte of a double-byte character, used by JIS X 0208
First byte of a double-byte NEC or NEC-selected extension character
Not used as first byte, unallocated space in JIS X 0208
First byte of a double-byte IBM extension character
First byte of a double-byte IBM-designated user defined character
Not used as first byte, best-fit mapped as single byte to private use area
Second byte of a double-byte character whose first half of the JIS sequence was odd
Second byte of a double-byte character whose first half of the JIS sequence was even
Unused as second byte of a double-byte character


See also

[edit]

References

[edit]
  1. ^abcMozilla Foundation."Notable Differences from IANA Naming".Crate encoding_rs. docs.rs.
  2. ^Sivonen, Henri."Bug 27851 - Add MS932 as a label of Shift_JIS".w3.org Bug Tracker.
  3. ^abcde"Converter Explorer: ibm-943_P15A-2003 (alias windows-31j)".International Components for Unicode: ICU Demonstration.
  4. ^Aoki, Osamu."Chapter 11. Data conversion".Debian Reference. Debian.
  5. ^abcde"IBM-943 and IBM-932".IBM Knowledge Center. IBM.
  6. ^ab"Coded character set identifiers - CCSID 943".IBM Globalization. IBM. Archived fromthe original on 2016-03-15.
  7. ^ab"Encoding.WindowsCodePage Property - .NET Framework (current version)".MSDN. Microsoft.
  8. ^abc"Converter Explorer: ibm-943_P130-1999".International Components for Unicode: ICU Demonstration.
  9. ^abc"Character Sets". IANA.
  10. ^van Kesteren, Anne."4.2. Names and labels".Encoding Standard. WHATWG.
  11. ^van Kesteren, Anne."5. Indexes (§ Index jis0208)".Encoding Standard. WHATWG.
  12. ^ab"7.2.3. Standard Encodings".Python 3.6 Documentation. Python Software Foundation. Retrieved19 September 2017.
  13. ^Kaplan, Michael S (2007-05-26)."The PUA outside of Unicode".Sorting it all out.
  14. ^abLunde, Ken (2009)."Appendix E: Vendor Character Set Standards"(PDF).CJKV Information Processing: Chinese, Japanese, Korean & Vietnamese Computing (2nd ed.).Sebastopol, CA:O'Reilly.ISBN 978-0-596-51447-1.
  15. ^Japanese Industrial Standards Committee (2004-04-13).Japanese Graphic Character Set for Information Interchange, Plane 1(PDF). ITSCJ/IPSJ.ISO-IR-233.
  16. ^van Kesteren, Anne."Index jis0208 visualization".Encoding Standard. WHATWG.
  17. ^abcd"Ambiguities in conversion from Shift-JIS to Unicode (Non-Normative)".XML Japanese Profile. W3C.
  18. ^"Converter Explorer: ibm-943_P15A-2003: start byte 0x81".ICU Demonstration. International Components for Unicode.
  19. ^"Converter Explorer: ibm-943_P130-1999: start byte 0x81".ICU Demonstration. International Components for Unicode.
  20. ^ab"CP932.TXT". Unicode Consortium.
  21. ^ab"Lead byte NULL — Code page 932". Microsoft.
  22. ^van Kesteren, Anne."12.3.1. Shift_JIS decoder".Encoding Standard. WHATWG.If byte is an ASCII byte or 0x80, return a code point whose value is byte.
  23. ^abKaplan, Michael S. (2005-09-17)."When is a backslash not a backslash?".Sorting it all out.
  24. ^ab"CP00897.txt". IBM.
  25. ^"Code page identifiers - CP 00897".IBM Globalization. IBM. Archived fromthe original on 2016-03-17.

External links

[edit]

Microsoft related

[edit]

IBM related

[edit]
Early telecommunications
ISO/IEC 8859
Bibliographic use
National standards
ISO/IEC 2022
Mac OSCode pages
("scripts")
DOS code pages
IBM AIX code pages
Windows code pages
EBCDIC code pages
DEC terminals (VTx)
Platform specific
Unicode /ISO/IEC 10646
TeX typesetting system
Miscellaneous code pages
Control character
Related topics
Retrieved from "https://en.wikipedia.org/w/index.php?title=Code_page_932_(Microsoft_Windows)&oldid=1305857277"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp