Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
4.8 KiB

  1. Mapping files for Japanese encodings
  2. 1998 12/25
  3. Fuji Xerox Information Systems
  4. MURATA Makoto
  5. 1. Overview
  6. This version of XML::Parser and XML::Encoding does not come with map files for
  7. the charset "Shift_JIS" and the charset "euc-jp". Unfortunately, each of these
  8. charsets has more than one mapping. None of these mappings are
  9. considered as authoritative.
  10. Therefore, we have come to believe that it is dangerous to provide map files
  11. for these charsets. Rather, we introduce several private charsets and map
  12. files for these private charsets. If IANA, Unicode Consoritum, and JIS
  13. eventually reach a consensus, we will be able to provide map files for
  14. "Shift_JIS" and "euc-jp".
  15. 2. Different mappings from existing charsets to Unicode
  16. 1) Different mappings in JIS X0221 and Unicode
  17. The mapping between JIS X0208:1990 and Unicode 1.1 and the mapping
  18. between JIS X0212:1990 and Unicode 1.1 are published from Unicode
  19. consortium. They are available at
  20. ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/JIS0208.TXT and
  21. ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/JIS0212.TXT,
  22. respectively.) These mapping files have a note as below:
  23. # The kanji mappings are a normative part of ISO/IEC 10646. The
  24. # non-kanji mappings are provisional, pending definition of
  25. # official mappings by Japanese standards bodies.
  26. Unfortunately, the non-kanji mappings in the Japanese standard for ISO 10646/1,
  27. namely JIS X 0221:1995, is different from the Unicode Consortium mapping since
  28. 0x213D of JIS X 0208 is mapped to U+2014 (em dash) rather than U+2015
  29. (horizontal bar). Furthermore, JIS X 0221 clearly says that the mapping is
  30. informational and non-normative. As a result, some companies (e.g., Microsoft and
  31. Apple) have introduced slightly different mappings. Therefore, neither the
  32. Unicode consortium mapping nor the JIS X 0221 mapping are considered as
  33. authoritative.
  34. 2) Shift-JIS
  35. This charset is especially problematic, since its definition has been unclear
  36. since its inception.
  37. The current registration of the charset "Shift_JIS" is as below:
  38. >Name: Shift_JIS (preferred MIME name)
  39. >MIBenum: 17
  40. >Source: A Microsoft code that extends csHalfWidthKatakana to include
  41. > kanji by adding a second byte when the value of the first
  42. > byte is in the ranges 81-9F or E0-EF.
  43. >Alias: MS_Kanji
  44. >Alias: csShiftJIS
  45. First, this does not reference to the mapping "Shift-JIS to Unicode"
  46. published by the Unicode consortium (available at
  47. ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/SHIFTJIS.TXT).
  48. Second, "kanji" in this registration can be interepreted in different ways.
  49. Does this "kanji" reference to JIS X0208:1978, JIS X0208:1983, or JIS
  50. X0208:1990(== JIS X0208:1997)? These three standards are *incompatible* with
  51. each other. Moreover, we can even argue that "kanji" refers to JIS X0212 or
  52. ideographic characters in other countries.
  53. Third, each company has extended Shift JIS. For example, Microsoft introduced
  54. OEM extensions (NEC extensionsand IBM extensions).
  55. Forth, Shift JIS uses JIS X0201, which is almost upper-compatible with US-ASCII
  56. but is not quite. 5C and 7E of JIS X 0201 are different from backslash and
  57. tilde, respectively. However, many programming languages (e.g., Java)
  58. ignore this difference and assumes that 5C and 7E of Shift JIS are backslash
  59. and tilde.
  60. 3. Proposed charsets and mappings
  61. As a tentative solution, we introduce two private charsets for EUC-JP and four
  62. priviate charsets for Shift JIS.
  63. 1) EUC-JP
  64. We have two charsets, namely "x-eucjp-unicode" and "x-eucjp-jisx0221". Their
  65. difference is only one code point. The mapping for the former is based
  66. on the Unicode Consortium mapping, while the latter is based on the JIS X0221
  67. mapping.
  68. 2) Shift JIS
  69. We have four charsets, namely x-sjis-unicode, x-sjis-jisx0221,
  70. x-sjis-jdk117, and x-sjis-cp932.
  71. The mapping for the charset x-sjis-unicode is the one published by the Unicode
  72. consortium. The mapping for x-sjis-jisx0221 is almost equivalent to
  73. x-sjis-unicode, but 0x213D of JIS X 0208 is mapped to U+2014 (em dash) rather
  74. than U+2015. The charset x-sjis-jdk117 is again almost equivalent to
  75. x-sjis-unicode, but 0x5C and 0x7E of JIS X0201 are mapped to backslash and
  76. tilde.
  77. The charset x-sjis-cp932 is used by Microsoft Windows, and its mapping is
  78. published from the Unicode Consortium (available at:
  79. ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.txt). The
  80. coded character set for this charset includes NEC-extensions and
  81. IBM-extensions. 0x5C and 0x7E of JIS X0201 are mapped to backslash and tilde;
  82. 0x213D is mapped to U+2015; and 0x2140, 0x2141, 0x2142, and 0x215E of JIS X
  83. 0208 are mapped to compatibility characters.
  84. Makoto
  85. Fuji Xerox Information Systems
  86. Tel: +81-44-812-7230 Fax: +81-44-812-7231
  87. E-mail: [email protected]