Japanese language in EBCDIC explained

Several mutually incompatible versions of the Extended Binary Coded Decimal Interchange Code (EBCDIC) have been used to represent the Japanese language on computers, including variants defined by Hitachi, Fujitsu, IBM and others. Some are variable-width encodings, employing locking shift codes to switch between single-byte and double-byte modes. Unlike other EBCDIC locales, the lowercase basic Latin letters are often not preserved in their usual locations.

The characters which are found in the double-byte Japanese code used with EBCDIC by IBM, but not found in the first edition of JIS X 0208, also influenced the vendor extensions found in some non-EBCDIC encodings such as IBM code page 932 ("DBCS-PC") and Windows code page 932.

Single-byte codes

Similarly to JIS X 0201 (itself incorporated into Shift JIS), Japanese EBCDIC encodings often include a set of single-byte katakana. Several different variants of the single-byte EBCDIC code are used in the Japanese locale, by different vendors; a given vendor may also define two different single-byte codes, one favoured for half-width katakana and one favoured for Latin script. Variants of EBCDIC favoured by a given vendor for use for katakana are sometimes referred to as EBCDIK, standing for Extended Binary-Coded Decimal Interchange Kana code.[1]

Code pages incorporating half-width kana are an exception to IBM's EBCDIC invariant character set, which specifies a set of characters which are usually encoded the same across all EBCDIC code pages. Most notably, they sometimes include katakana characters at code points which are used for lowercase letters of the Basic Latin alphabet in the invariant set.[2] Encoding of lowercase letters when katakana characters are included at those locations, and encoding of katakana characters when lowercase letters are retained in their usual locations, can vary between vendors, as shown below.

Microsoft Windows implements two Japanese single-byte EBCDIC variants, with code page numbers 20000 higher than IBM's code page numbers for its variants, as code pages 20290 (documented as, "IBM EBCDIC Japanese Katakana Extended")[3] and 21027 ("Extended/Ext Alpha Lowercase"). Code page 21027 as implemented in Windows is an incomplete implementation, lacking two-way mappings for several letters and kana,[4] and is currently deprecated.[3]

IBM's code pages were later updated to include the Euro sign at 0xE1, retaining their original CPGID numbers, but being assigned new CCSID numbers. Hence, the CCSID 290 refers to the original version of code page 290, while the version of code page 290 with the Euro sign is also known as CCSID 8482.[5] Similarly, CCSID 1027 refers to the original version of code page 1027, while the version of CPGID 1027 with the Euro sign is given the CCSID 5123.[6]

Alongside versions of IBM's double-byte Japanese DBCS-Host code page (CPGID 300, CCSID 300 or 16684) as a double-byte component, IBM code page 290 is used as the single-byte component of the multi-byte code page IBM-930[7] [8] and (as the Euro-updated CCSID 8482) the updated version IBM-1390.[9] [10] IBM code page 1027 is used as the single-byte component of the multi-byte code page IBM-939[11] [12] and (as the Euro-updated CCSID 5123) the updated version IBM-1399.[13] [14]

In the following table, conformance to the invariant set is marked with green; collision with the invariant set is marked with red.

Single-byte codes in Japanese EBCDIC variants (excluding control codes)
HexadecimalLowercase in invariant locations, kana absent or displacedLowercase absent or displaced by kana
Fujitsu EBCDIC[15] Hitachi EBCDIC[16] HP EBCDIK[17] IBM 298[18] IBM 1027
[19] [20]
IBM 1031[21] Fujitsu EBCDIKHitachi EBCDIK
IBM 1136[22]
NEC EBCDIC[23] [24] IBM 290
[25] [26]
IBM 887[27] IBM 1030[28]
0x40
0x41
0x42
0x43
0x44
0x45
0x46
0x47
0x48
0x49
0x4A£[| {{Character set color|undef}} | |¢ |¢ |¢ |£ |[ |[ |£ |£ |£ |- {{good||align=left}} !0x4B |. |. |. |. |. |. |. |. |. |. |. |. |- {{good||align=left}} !0x4C |< |< |{{no2||align=left}}) |< |< |< |< |< |< |< |< |< |- {{good||align=left}} !0x4D |(|(|{{no2||align=left}}[ |(|(|(|(|(|(|(|(|(|- {{good||align=left}} !0x4E | + | + |{{no2||align=left}}< | + | + | + | + | + | + | + | + | + |- !0x4F |{{pipe}} |! | {{Character set color|undef}} | |{{pipe}} |{{pipe}} |{{pipe}} |{{pipe}} |! |! |{{pipe}} |{{pipe}} |{{pipe}} |- {{good||align=left}} !0x50 |& |& |{{no2||align=left}} + |& |& |& |& |& |& |& |& |& |- !0x51 |{{Character set color|undef}}| |ゥ |ゥ |ゥ |ゥ |ゥ |ェ |ェ |ェ |ェ |ェ |ェ |- !0x52 |{{Character set color|undef}}| |ェ |ェ |ェ |ェ |ェ |ォ |ォ |ォ |ォ |ォ |ォ |- !0x53 |{{Character set color|undef}}| |ォ |ォ |ォ |ォ |ォ |ャ |ャ |ャ |ャ |ャ |ャ |- !0x54 |{{Character set color|undef}}| |ャ |ャ |ャ |ャ |ャ |ュ |ュ |ュ |ュ |ュ |ュ |- !0x55 |{{Character set color|undef}}| |ュ |ュ |ュ |ュ |ュ |ョ |ョ |ョ |ョ |ョ |ョ |- !0x56 |{{Character set color|undef}}| |ョ |ョ |ョ |ョ |ョ |ッ |ッ |ッ |ッ |ッ |ッ |- !0x57 |{{Character set color|undef}}| |ッ |ッ |ッ |ッ |ッ |{{Character set color|undef}}| | {{Character set color|undef}} | |a |{{Character set color|undef}}| | {{Character set color|undef}} | |{{Character set color|undef}}| |- !0x58 |{{Character set color|undef}}| |ー |ー |ー |ー |ー |ー |ー |ー |ー |ー |ー |- !0x59 |{{Character set color|undef}}| |ア |ア |ア |ア |ア |{{Character set color|undef}}| |a |b |{{Character set color|undef}}| | {{Character set color|undef}} | |{{Character set color|undef}}| |- !0x5A |! |]| ||!|!|!|!|]|]|!|!|!|-!0x5B|\|¥|$|$|$|$|\|¥|\|¥|¥|¥|- !0x5C|*|*|*|*|*|*|*|*|*|*|*|*|- !0x5D|)|)|])))))))))
0x5E
0x5F¬^¬¬¬¬^^¬¬¬
0x60------------
0x61////////////
0x62bcaa
0x63cdbb
0x64decc
0x65efdd
0x66fgee
0x67ghff
0x68higg
0x69ijhh
0x6A¦¦
0x6B,,,,,,,,,,,,
0x6C%%(%%%%%%%%%
0x6D____________
0x6E>>¥>>>>>>>>>
0x6F???????????
0x70jk[| {{Character set color|undef}} | |[ |- !0x71 |{{Character set color|undef}}| |サ |サ |サ |サ |サ |{{Character set color|undef}}| |k |l |i | {{Character set color|undef}} | |i |- !0x72 |{{Character set color|undef}}| |シ |シ |シ |シ |シ |{{Character set color|undef}}| |l |m |j | {{Character set color|undef}} | |j |- !0x73 |{{Character set color|undef}}| |ス |ス |ス |ス |ス |{{Character set color|undef}}| |m |n |k | {{Character set color|undef}} | |k |- !0x74 |{{Character set color|undef}}| |セ |セ |セ |セ |セ |{{Character set color|undef}}| |n |o |l | {{Character set color|undef}} | |l |- !0x75 |{{Character set color|undef}}| |ソ |ソ |ソ |ソ |ソ |{{Character set color|undef}}| |o |p |m | {{Character set color|undef}} | |m |- !0x76 |{{Character set color|undef}}| |タ |タ |タ |タ |タ |{{Character set color|undef}}| |p |q |n | {{Character set color|undef}} | |n |- !0x77 |{{Character set color|undef}}| |チ |チ |チ |チ |チ |{{Character set color|undef}}| |q |r |o | {{Character set color|undef}} | |o |- !0x78 |{{Character set color|undef}}| |ツ |ツ |ツ |ツ |ツ |{{Character set color|undef}}| |r |s |p | {{Character set color|undef}} | |p |- !0x79 |` |` |` |` |` |` |` |` |` |` | {{Character set color|undef}} | |` |- {{good||align=left}} !0x7A |: |: | {{Character set color|undef}} | |: |: |: |: |: |: |: |: |: |- !0x7B |# |# |= |# |# |# |# |# |# |# |# |# |- !0x7C |@ |@ |' |@ |@ |@ |@ |@ |@ |@ |@ |@ |- {{good||align=left}} !0x7D |' |' |{{no2||align=left}}: |' |' |' |' |' |' |' |' |' |- {{good||align=left}} !0x7E |= |= |{{no2||align=left}}> |= |= |= |= |= |= |= |= |= |- {{good||align=left}} !0x7F |" |" |" |" |" |" |" |" |" |" |" |" |- !0x80 |{{Character set color|undef}}| |テ |テ |テ | {{Character set color|undef}} | | {{Character set color|undef}} | |{{Character set color|undef}}| |s |t |]| ||]
0x81aaaaaa
0x82bbbbbb
0x83cccccc
0x84dddddd
0x85eeeeee
0x86ffffff
0x87gggggg
0x88hhhhhh
0x89iiiiii
0x8A
0x8Btuqq
0x8C
0x8D
0x8E
0x8F
0x90ソソソソソソ
0x91jjjjjj
0x92kkkkkk
0x93llllll
0x94mmmmmm
0x95nnnnnn
0x96oooooo
0x97pppppp
0x98qqqqqq
0x99rrrrrr
0x9A
0x9Buvrr
0x9Cvw
0x9D
0x9E
0x9F
0xA0¯¯wx~~
0xA1~~¯~~~~~~¯¯¯
0xA2ssssss
0xA3tttttt
0xA4uuuuuu
0xA5vvvvvv
0xA6wwwwww
0xA7xxxxxx
0xA8yyyyyy
0xA9zzzzzz
0xAA
0xABxyss
0xAC
0xAD[|[ |ラ |ラ |ラ |ラ |ラ |ラ |- !0xAE |{{Character set color|undef}}| |ヨ |ヨ |ヨ |メ |メ |リ |リ |リ |リ |リ |リ |- !0xAF |{{Character set color|undef}}| |ラ |ラ |ラ |モ |モ |ル |ル |ル |ル |ル |ル |- !0xB0 |{{Character set color|undef}}| |リ |リ |リ |^ |^ |{{Character set color|undef}}| |y |z |^ | {{Character set color|undef}} | |^ |- !0xB1 |{{Character set color|undef}}| |ル |ル |ル |£ |£ |{{Character set color|undef}}| |z | {{Character set color|undef}} | |¢ | {{Character set color|undef}} | |¢ |- !0xB2 |{{Character set color|undef}}| |レ |レ |レ |¥ |¥ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |\ | {{Character set color|undef}} | |\ |- !0xB3 |{{Character set color|undef}}| |ロ |ロ |ロ |ヤ |ヤ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |t | {{Character set color|undef}} | |t |- !0xB4 |{{Character set color|undef}}| |ワ |ワ |ワ |ユ |ユ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |u | {{Character set color|undef}} | |u |- !0xB5 |{{Character set color|undef}}| |ン |ン |ン |ヨ |ヨ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |v | {{Character set color|undef}} | |v |- !0xB6 |{{Character set color|undef}}| |゙ |゙ |゙ |ラ |ラ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |w | {{Character set color|undef}} | |w |- !0xB7 |{{Character set color|undef}}| |゚ |゚ |゚ |リ |リ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |x | {{Character set color|undef}} | |x |- !0xB8 |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | | {{Character set color|undef}} | |ル |ル |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |y | {{Character set color|undef}} | |y |- !0xB9 |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | | {{Character set color|undef}} | |レ |レ |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | |z | {{Character set color|undef}} | |z |- !0xBA |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | | {{Character set color|undef}} | |ロ |ロ |レ |レ |レ |レ |レ |レ |- !0xBB |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | | {{Character set color|undef}} | |ワ |ワ |ロ |ロ |ロ |ロ |ロ |ロ |- !0xBC |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | | {{Character set color|undef}} | |ン |ン |ワ |ワ |ワ |ワ |ワ |ワ |- !0xBD |{{Character set color|undef}}| | {{Character set color|undef}} | | {{Character set color|undef}} | | {{Character set color|undef}} | |]|]
0xBE
0xBF
0xC0
0xD1JJJJJJJJJJJJ
0xD2KKKKKKKKKKKK
0xD3LLLLLLLLLLLL
0xD4MMMMMMMMMMMM
0xD5NNNNNNNNNNNN
0xD6OOOOOOOOOOOO
0xD7PPPPPPPPPPPP
0xD8QQQQQQQQQQQQ
0xD9RRRRRRRRRRRR
0xDA
0xDB°
0xDC±
0xDD
0xDE
0xDF
0xE0$$¥\\$$$$$$
0xE1
0xE2SSSSSSSSSSSS
0xE3TTTTTTTTTTTT
0xE4UUUUUUUUUUUU
0xE5VVVVVVVVVVVV
0xE6WWWWWWWWWWWW
0xE7XXXXXXXXXXXX
0xE8YYYYYYYYYYYY
0xE9ZZZZZZZZZZZZ
0xEA
0xEB
0xEC
0xED
0xEE
0xEFΩ
0xF0000000000000
0xF1111111111111
0xF2222222222222
0xF3333333333333
0xF4444444444444
0xF5555555555555
0xF6666666666666
0xF7777777777777
0xF8888888888888
0xF9999999999999
0xFA
0xFB
0xFC
0xFD
0xFE

Double-byte codes

See also: IBM Kanji System. There are three double-byte character codes used for Japanese with EBCDIC:[29] IBM code page 300 (also called IBM Kanji or IBM Japanese DBCS-Host) from IBM, KEIS from Hitachi,[30] and JEF from Fujitsu.[15] These are DBCS-Host encodings, using different shift codes to switch between single-byte EBCDIC and double-byte modes. Codes 0x41 through 0xFE (those used for graphic characters in EBCDIC) are used in pairs to represent characters from a 190×190 grid; code 0x40 (space in EBCDIC) is used doubled as an ideographic space, but not as part of any other double-byte code.

In the IBM version of the DBCS-Host code, the code switches to single-byte mode and the code switches to double-byte mode,[7] [11] [9] [13] in common with IBM double-byte EBCDIC codes for other CJK languages, such as the EBCDIC version of Johab for Korean.[31] In contrast to KEIS and JEF, the layout of IBM code page 300 is unrelated to JIS X 0208, and conversion between the two must be done via a table; however, its character repertoire has been kept up-to-date with successive revisions of JIS X 0208 so as to remain a superset of JIS X 0208's repertoire. Lead bytes 0x41 through 0x44 are used for non-Kanji characters, lead bytes 0x45 through 0x68 are used for Kanji characters, and lead bytes 0x69 through 0x89 are used for UDC (user-defined characters).[32]

The existence of IBM's Japanese DBCS-Host code had impact beyond EBCDIC systems, since IBM also defined variants of Shift JIS ("DBCS-PC", defined in the pure double-byte Code page 301 and used in the variable width Code page 932 and Code page 942) and of EUC-JP which encode the entire repertoire of IBM code page 300, including 28 non-Kanji and 360 Kanji additional to those originally included in JIS X 0208 (although the non-Kanji because sign ∵ and not sign ¬ were later added to JIS X 0208 in 1983). These are referred to as "IBM-selected" characters and are included as extensions in, for example, Windows code page 932.

Some newer revisions of the IBM-300 code page add additional Kanji with lead bytes 0xB8 through 0xD5 and additional non-Kanji with lead bytes 0xD6 through 0xE9.[32] This revision updated the set for JIS X 0213, including the Euro sign and, while retaining the CPGID 300, was assigned the new CCSID 16684.[33] The code pages IBM-930 (with code page 290 as the single-byte set),[7] IBM-931 (with code page 37 as the single-byte set), and IBM-939 (with code page 1027 as the single-byte set)[11] exclude these additions, while IBM-1390 (with the Euro sign version of code page 290 / CCSID 8482)[9] and IBM-1399 (with the Euro sign version of code page 1027 / CCSID 5123)[13] include them.

In Hitachi KEIS (Kanji-processing Extended Information System), the sequence switches to single-byte mode and the sequence switches to double-byte mode. JIS X 0208 characters are encoded using the same byte sequences used to encode them in EUC-JP, i.e. with both bytes being between 0xA1 and 0xFE inclusive. This results in duplicate encodings for the —0x4040 per the DBCS-Host code structure, and 0xA1A1 as in EUC-JP. However, the lead byte range is extended back to 0x59, out of which the lead bytes 0x81–A0 are designated for user-defined characters, and the remainder are used for corporate-defined characters, including both kanji and non-kanji.

In Fujitsu JEF[15] (Japanese-processing Extended Feature), switches to single-byte mode and switches to double-byte mode. Similarly to KEIS, JIS X 0208 codes are represented the same as in EUC-JP. Differing from KEIS, the JIS X 0208 edition used in this JEF zone is the original JIS C 6226:1978.[30] [15] The lead byte range is extended back to 0x41, with 0x80–A0 designated for user definition; lead bytes 0x41–7F are assigned row numbers 101 through 163 for kuten purposes, although row 162 (lead byte 0x7E) is unused. Rows 101 through 148 are used for extended kanji, while rows 149 through 163 are used for extended non-kanji.

Notes and References

  1. Web site: EBCDIK: Extended Binary Coded Decimal Interchange Kana Code . 通信用語の基礎知識.
  2. Web site: Invariant character set . IBM i 7.1 Documentation . 14 August 2018 . IBM.
  3. Web site: Code Page Identifiers . Microsoft . Windows Dev Center.
  4. Web site: Code Page 21027 "Extended/Ext Alpha Lowercase". Steele . Shawn . .
  5. Web site: https://web.archive.org/web/20141129224816/http://www-01.ibm.com/software/globalization/ccsid/ccsid8482.html . CCSID 8482 . 2014-11-29 . Coded character set identifiers . IBM.
  6. Web site: https://web.archive.org/web/20141129220428/http://www-01.ibm.com/software/globalization/ccsid/ccsid5123.html . CCSID 5123 . 2014-11-29 . Coded character set identifiers . IBM.
  7. Web site: ibm-930_P120-1999 . . Unicode Consortium.
  8. Web site: https://web.archive.org/web/20141201220633/http://www-01.ibm.com/software/globalization/ccsid/ccsid930.html . CCSID 930 . 2014-12-01 . Coded character set identifiers . IBM.
  9. Web site: ibm-1390_P110-2003 . . Unicode Consortium.
  10. Web site: https://web.archive.org/web/20141129214107/http://www-01.ibm.com/software/globalization/ccsid/ccsid1390.html . CCSID 1390 . 2014-11-29 . Coded character set identifiers . IBM.
  11. Web site: ibm-939_P120-1999 . . Unicode Consortium.
  12. Web site: https://web.archive.org/web/20141201211156/http://www-01.ibm.com/software/globalization/ccsid/ccsid939.html . CCSID 939 . 2014-12-01 . Coded character set identifiers . IBM.
  13. Web site: ibm-1399_P110-2003 . . Unicode Consortium.
  14. Web site: https://web.archive.org/web/20141129220252/http://www-01.ibm.com/software/globalization/ccsid/ccsid1399.html . CCSID 1399 . 2014-11-29 . Coded character set identifiers . IBM.
  15. Web site: jef4j: JEF charset support for Java . Izuno . Hidekatsu. . 20 October 2021 .
  16. Web site: EBCDIC/EBCDIKのコード表. Hitachi. 2021-05-29. 2021-06-03. https://web.archive.org/web/20210603104757/http://itdoc.hitachi.co.jp/manuals/3020/30203J3820/ISUS0268.HTM. dead.
  17. Web site: JIS/EBCDIK Conversion Table . FCOPY Reference Manual . Hewlett-Packard. http://www.3kranger.com/HP3000/mpeix/en-mpe60/32212-90008/apcs02.html Note: table in source maps all input bytes, sometimes to codes not actually defined in JIS X 0201, but is asymmetric and does not always round-trip. Characters shown here are those where the tables in the source round-trip map characters to codes actually defined in JIS X 0201.
  18. Web site: Code Page 00298 . https://web.archive.org/web/20150708035845/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp00298z.pdf . dead . 2015-07-08 . IBM.
  19. Web site: Code Page 01027 . REGISTRY: Graphic Character Sets and Code Pages . . 1999.
  20. Web site: Code Page 01027 . https://web.archive.org/web/20150708060448/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp01027z.pdf . dead . 2015-07-08 . IBM.
  21. Web site: Code Page 01031 . https://web.archive.org/web/20150708044335/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp01031z.pdf . dead . 2015-07-08 . IBM.
  22. Web site: Code Page 01136 . https://web.archive.org/web/20150708060448/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp01136z.pdf . dead . 2015-07-08 . IBM.
  23. Web site: EBCDICカナ文字からの変換 . ja . コード変換 マニュアル - はじめに (HULFT8) . Saison Information Systems .
  24. Web site: EBCDIC-kana . Moriyoshi . Koizumi.
  25. Web site: Code Page 00290 . REGISTRY: Graphic Character Sets and Code Pages . . 1999.
  26. Web site: Code Page 00290 . https://web.archive.org/web/20150708060448/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp00290z.pdf . dead . 2015-07-08 . IBM.
  27. Web site: Code Page 00887 . https://web.archive.org/web/20150708025342/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp00887z.pdf . dead . 2015-07-08 . IBM.
  28. Web site: Code Page 01030 . https://web.archive.org/web/20150708023036/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp01030z.pdf . dead . 2015-07-08 . IBM.
  29. Web site: 2 Codesets and Codeset Conversion . DIGITAL UNIX Technical Reference for Using Japanese Features . Compaq.
  30. Web site: 付録K.3 文字コード変換 . Hitachi.
  31. Web site: ibm-1364_P110-2007 . . Unicode Consortium.
  32. Web site: IBM Japanese Graphic Character Set, Kanji . IBM Corporate Specification C-H 3-3220-024 . 1999 . IBM.
  33. Web site: https://web.archive.org/web/20141129221324/http://www-01.ibm.com/software/globalization/ccsid/ccsid16684.html . CCSID 16684 . 2014-11-29 . Coded character set identifiers . IBM.