home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / protocol / kanji.txt < prev    next >
Text File  |  2020-01-01  |  8KB  |  193 lines

  1.                KERMIT PROTOCOL FOR JAPANESE TEXT FILE TRANSFER
  2.  
  3.                        Christine Gianone, Frank da Cruz
  4.                               The Kermit Project
  5.                              Columbia University
  6.  
  7.                               Dr. Hirofumi Fujii
  8.               Japan National Laboratory for High Energy Physics
  9.  
  10.                                30 Sepember 1999
  11.  
  12.                [ Updating the original draft of 28 March 1991 ]
  13.  
  14. ABSTRACT
  15.  
  16. Several different Kanji computer codes exist, so a unified method is needed
  17. for transferring Kanji text between computers that use different codes.
  18. Several methods are examined, and one is chosen.
  19.  
  20. This proposal does not address transfer of Japanese files composed only of
  21. Roman and Katakana single-byte characters, for which well-defined mechanisms
  22. already exist.
  23.  
  24.  
  25. BACKGROUND
  26.  
  27. The Kermit protocol transfers text files using a common intermediate
  28. representation for text.  The protocol was extended in 1989-90 to allow for
  29. use of different standard character sets within Kermit packets.  To transfer
  30. text written in a particular language, the sending program translates from its
  31. local character set to the standard set for that language, and the receiver
  32. translates from the standard set to its own local set.  Thus, each Kermit
  33. program needs to know only its local character sets and the standard ones, and
  34. does not need to know about nonstandard sets used by other computers.
  35.  
  36. MS-DOS Kermit 3.0 for the IBM PC, C-Kermit 5A for UNIX and VAX/VMS, and IBM
  37. mainframe Kermit 4.2 for MVS/TSO and VM/CMS were the first to implement
  38. character-set translation; this included most European languages written with
  39. Roman and Cyrillic alphabets (and, in some cases, also Greek, Hebrew, and
  40. Japanese Katakana).
  41.  
  42. Extending the protocol to the full Japanese writing system, however, poses
  43. special problems because it requires mixture of three distinct character sets
  44. -- Roman, Katakana, and Kanji -- and because the Kanji character set is very
  45. large compared to Western alphabets or syllabaries.
  46.  
  47.  
  48. CHARACTER SETS USED IN JAPAN
  49.  
  50. Japanese standards exist for three different character sets:
  51.  
  52. 1. JIS Roman, ISO 646 Japanese Version, ISO registration number 14.  A
  53. 94-character single-byte set identical to US ASCII except in positions 05/12
  54. (ASCII backslash replaced by Yen sign) and 07/14 (ASCII tilde replaced by
  55. macron or overbar).  Hereafter referred to as Roman.
  56.  
  57. 2. JIS Katakana, ISO registration number 13.  A 94-character single-byte set
  58. containing Katakana characters in columns 2 through 5, with columns 6 and 7
  59. unused.  JIS X 0201 specifies the combination of (1) and (2) into a
  60. single-byte 8-bit character set.
  61.  
  62. 3. JIS X 0208 Multiple-Byte Character Set, ISO Registration Number 87.  A
  63. two-byte character set comprising approximately 6000 Kanji characters, in
  64. which each byte is a 7-bit value, and the high-order ("8th") bit of each byte
  65. is unused.  JIS X 0208 includes not only Kanji, but also Roman, Hiragana,
  66. Katakana, Greek, and Cyrillic characters.  The non-Kanji JIS X 0208 characters
  67. are double width and not normally used.  JIS X 0208 consists of approximately
  68. 6400 defined characters, with additional space reserved for nonstandard
  69. characters ("Gaiji").
  70.  
  71. Some Japanese computers use entirely different character sets, for example the
  72. EBCDIC Kanji that is used on IBM and similar mainframes.  Most Japanese
  73. computers, however, use a combination of the three standard character sets.
  74. Different methods are used to allow characters from these different sets to
  75. coexist within a file.
  76.  
  77. Shift-JIS, commonly found on PCs, uses special byte values 80-A0 (hex) and
  78. E0-FE (hex) as lead-ins for two-byte Kanji sequences, of which the second byte
  79. can have any value (the 8th bit can be 0 or 1).  Bytes in the 00-7F range are
  80. Roman single-byte characters, and bytes in the A1-DF range are Katakana
  81. single-byte characters.  Shift-JIS shifts each 96-byte Kanji plane left by two
  82. columns, so all control regions are filled with graphics, and also fills up
  83. the unused columns in Katakana with Kanji.  Can translate to/from EUC by
  84. algorithm, no table necessary.  Microsoft Code Page 932 and Hewlett Packard
  85. HP-15 are the same as Shift-JIS.  Shift-JIS is also used on the Macintosh and
  86. on certain UNIX platforms such as Sony NEWS.
  87.  
  88. JIS-7 embeds ISO 2022 character set designation sequences in the text to
  89. switch among double-byte Kanji and single-byte Roman/Katakana.  All Kanji
  90. bytes are encoded with the 8th bit set to zero.  HP-16 is the same as JIS-7.
  91.  
  92. AT&T EUC (Extended Unix Code) for Japan (sometimes called JAE, for Japanese
  93. Application Environment) sets the 8th bit of each Kanji byte to 1, allowing
  94. Kanji bytes to be easily distinguished from Roman (ASCII) bytes, whose 8th
  95. bits are 0.  A single-shift mechanism is used to select single-byte Katakana
  96. characters:
  97.  
  98.   0XXXXXXX
  99.     A Roman character (control or graphic).  Stands alone.
  100.  
  101.   10001111
  102.     Single Shift 3 (SS3).  This means the next byte is a JIS Katakana
  103.     character.  The following byte also has its high-order bit set to 1.
  104.  
  105.   100XXXXX
  106.     A C1 control character.  C1 controls other than SS3 can be used to
  107.     designate Gaiji.
  108.  
  109.   1YYXXXXX
  110.     (YY is not 00)  The first byte of a 2-byte Kanji code.  The second
  111.     byte also has its high-order bit set to 1.
  112.  
  113. This scheme is compliant with ISO 2022 (JIS X 0202) as used in the 8-bit
  114. environment, with JIS Roman designated to G0 and invoked to GL, JIS Kanji
  115. designated to G1 and invoked in GR, JIS Katakana designated to G3 and invoked
  116. on a per-character basis with SS3.
  117.  
  118.  
  119. ALTERNATIVES
  120.  
  121. Kermit's transfer character set for Japanese should be a national or
  122. international standard, or closely related to one.  This leaves us with the
  123. following choices:
  124.  
  125. 1. JIS X 0208 (Level 1)
  126.  
  127.    Advantages:
  128.     . Simplicity.  This character set contains all the characters of Roman 
  129.       and Katakana as well as Kanji and all characters are the same size.
  130.     . Clarity.  JIS X 0208 has an ISO registration number that can be used
  131.       as an announcer.
  132.    Disadvantages:
  133.     . Noninvertability: the distinction between single-byte and double-byte
  134.       Roman and Katakana characters is lost.
  135.     . Transmission overhead of representing each Roman (ASCII) value in two
  136.       bytes.
  137.     . No computer uses JIS X 0208 by itself, so all Kermit programs will
  138.       have to translate between file and transfer character sets.
  139.  
  140. 2. Japanese EUC
  141.  
  142.    Advantages:
  143.     . Matches common usage, which mixes three character sets within a file.
  144.     . Half-width Roman and Katakana are not sacrificed.
  145.     . No translation necessary for many computer systems, such as UNIX and
  146.       VMS, which already use EUC.
  147.    Disadvantages:
  148.     . Variable-length characters.
  149.     . High transmission overhead for 8-bit values in 7-bit environment.
  150.  
  151. 3. ISO 10646 / UNICODE
  152.  
  153.    (Not ready in 1991, see below)
  154.  
  155. 4. A combination of JIS Roman, JIS Katakana, and JIS Kanji, with ISO
  156.    2022 designators and shifts (ISO 2022-JP):
  157.  
  158.    Advantages:
  159.     . Efficient transmission in the 7-bit environment.
  160.    Disadvantages:
  161.     . Complexity.  Kermit program must fully implement ISO 2022.
  162.     . Kermit's ISO 2022 extension has never been implemented [the idea
  163.       was later dropped].
  164.  
  165. Japanese EUC was chosen as the transfer character-set for Japanese text after
  166. consultation among various constituencies in Japan.  Implementations appeared
  167. in all major Kermit programs in 1991, with appropriate file character sets
  168. (JIS-7, Shift-JIS, DEC Kanji, various EBCDIC Kanjis) for each platform.  The
  169. transmission penalty on 7-bit connections was addressed by Kermit's Locking
  170. Shift option, which also benefits other "right-handed" character sets, such as
  171. ISO 8859 Cyrillic, Hebrew, Greek, etc.
  172.  
  173. Kermit name: JAPAN-EUC
  174. ISO Registration Numbers: 14 (Right half of JIS X 0201), 87 (JIS X 0208).
  175. Kermit Designator: I14/87/13.
  176.  
  177.   Unicode/ISO10646 support was added in 1999, with UCS-2 and UTF-8 allowed
  178.   as both file and transfer character sets.  In principal any Japanese
  179.   character-set can be converted to Unicode, and Unicode can be converted
  180.   to any Japanese character set (with the obvious potential for loss of
  181.   non-JIS characters).
  182.  
  183.  
  184. REFERENCES
  185.  
  186. 1. Gianone, Christine M., "A Kermit Protocol Extension for International
  187.    Character Sets", Columbia University, April 1990.
  188. 2. JIS X 0208 Multiple-Byte Character Set.
  189. 3. JIS X 0201 Single-Byte Character Set.
  190. 4. ISO 2022 "... Code Extension Techniques" (also JIS X 2020).
  191.  
  192. (End)
  193.