EBCDIC

EBCDIC（Extended Binary Coded Decimal Interchange Code，擴增二進式十進交換碼），為IBM於1963年－1964年間推出的字元編碼表，根據早期打孔機式的BCDIC即一種二進化十進數（BCD，Binary Coded Decimal）資訊交換編碼改進而成。是IBM迷爾級以上電腦的標準碼。

它的缺點是：英文字母不是連續地排列，中間出現多次斷續，為撰寫程式的人帶來了一些困難。

## 字符對應

EBCDIC編碼表，最初定義了（不計空白字符在內的）88個可列印字符，同時還定義了減去26個小寫字母後的62個可列印字符的子集：

0x｜U+0000 NULL｜U+0001 START OF HEADING｜U+0002 START OF TEXT｜U+0003 END OF TEXT｜U+0009 CHARACTER TABULATION｜U+007F DELETE｜U+000B LINE TABULATION｜U+000C FORM FEED (FF)｜U+000D CARRIAGE RETURN (CR)｜U+000E SHIFT OUT｜U+000F SHIFT IN

1x｜U+0010 DATA LINK ESCAPE｜U+0011 DEVICE CONTROL ONE｜U+0012 DEVICE CONTROL TWO｜U+0013 DEVICE CONTROL THREE｜U+0085 NEXT LINE (NEL)｜U+0008 BACKSPACE｜U+0018 CANCEL｜U+0019 END OF MEDIUM｜U+001C INFORMATION SEPARATOR FOUR｜U+001D INFORMATION SEPARATOR THREE｜U+001E INFORMATION SEPARATOR TWO｜U+001F INFORMATION SEPARATOR ONE

2x｜U+000A LINE FEED (LF)｜U+0017 END OF TRANSMISSION BLOCK｜U+001B ESCAPE｜U+0005 ENQUIRY｜U+0006 ACKNOWLEDGE｜U+0007 BELL

3x｜U+0016 SYNCHRONOUS IDLE｜U+0004 END OF TRANSMISSION｜U+0014 DEVICE CONTROL FOUR｜U+0015 NEGATIVE ACKNOWLEDGE｜U+001A SUBSTITUTE

4x｜U+0020 SPACE｜U+00A2 CENT SIGN｜U+002E FULL STOP｜U+003C LESS-THAN SIGN｜U+0028 LEFT PARENTHESIS｜U+002B PLUS SIGN｜U+007C VERTICAL LINE

5x｜U+0026 AMPERSAND｜U+0021 EXCLAMATION MARK｜U+0024 DOLLAR SIGN｜U+002A ASTERISK｜U+0029 RIGHT PARENTHESIS｜U+003B SEMICOLON｜U+00AC NOT SIGN

6x｜U+002D HYPHEN-MINUS｜U+002F SOLIDUS｜U+00A6 BROKEN BAR｜U+002C COMMA｜U+0025 PERCENT SIGN｜U+005F LOW LINE｜U+003E GREATER-THAN SIGN｜U+003F QUESTION MARK

7x｜U+0060 GRAVE ACCENT｜U+003A COLON｜U+0023 NUMBER SIGN｜U+0040 COMMERCIAL AT｜U+0027 APOSTROPHE｜U+003D EQUALS SIGN｜U+0022 QUOTATION MARK

8x｜U+0061 LATIN SMALL LETTER A｜U+0062 LATIN SMALL LETTER B｜U+0063 LATIN SMALL LETTER C｜U+0064 LATIN SMALL LETTER D｜U+0065 LATIN SMALL LETTER E｜U+0066 LATIN SMALL LETTER F｜U+0067 LATIN SMALL LETTER G｜U+0068 LATIN SMALL LETTER H｜U+0069 LATIN SMALL LETTER I

9x｜U+006A LATIN SMALL LETTER J｜U+006B LATIN SMALL LETTER K｜U+006C LATIN SMALL LETTER L｜U+006D LATIN SMALL LETTER M｜U+006E LATIN SMALL LETTER N｜U+006F LATIN SMALL LETTER O｜U+0070 LATIN SMALL LETTER P｜U+0071 LATIN SMALL LETTER Q｜U+0072 LATIN SMALL LETTER R

Ax｜U+007E TILDE｜U+0073 LATIN SMALL LETTER S｜U+0074 LATIN SMALL LETTER T｜U+0075 LATIN SMALL LETTER U｜U+0076 LATIN SMALL LETTER V｜U+0077 LATIN SMALL LETTER W｜U+0078 LATIN SMALL LETTER X｜U+0079 LATIN SMALL LETTER Y｜U+007A LATIN SMALL LETTER Z

Bx｜U+005E CIRCUMFLEX ACCENT｜U+005B LEFT SQUARE BRACKET｜U+005D RIGHT SQUARE BRACKET

Cx｜U+007B LEFT CURLY BRACKET｜U+0041 LATIN CAPITAL LETTER A｜U+0042 LATIN CAPITAL LETTER B｜U+0043 LATIN CAPITAL LETTER C｜U+0044 LATIN CAPITAL LETTER D｜U+0045 LATIN CAPITAL LETTER E｜U+0046 LATIN CAPITAL LETTER F｜U+0047 LATIN CAPITAL LETTER G｜U+0048 LATIN CAPITAL LETTER H｜U+0049 LATIN CAPITAL LETTER I

Dx｜U+007D RIGHT CURLY BRACKET｜U+004A LATIN CAPITAL LETTER J｜U+004B LATIN CAPITAL LETTER K｜U+004C LATIN CAPITAL LETTER L｜U+004D LATIN CAPITAL LETTER M｜U+004E LATIN CAPITAL LETTER N｜U+004F LATIN CAPITAL LETTER O｜U+0050 LATIN CAPITAL LETTER P｜U+0051 LATIN CAPITAL LETTER Q｜U+0052 LATIN CAPITAL LETTER R

Ex｜U+005C REVERSE SOLIDUS｜U+0053 LATIN CAPITAL LETTER S｜U+0054 LATIN CAPITAL LETTER T｜U+0055 LATIN CAPITAL LETTER U｜U+0056 LATIN CAPITAL LETTER V｜U+0057 LATIN CAPITAL LETTER W｜U+0058 LATIN CAPITAL LETTER X｜U+0059 LATIN CAPITAL LETTER Y｜U+005A LATIN CAPITAL LETTER Z

Fx｜U+0030 DIGIT ZERO｜U+0031 DIGIT ONE｜U+0032 DIGIT TWO｜U+0033 DIGIT THREE｜U+0034 DIGIT FOUR｜U+0035 DIGIT FIVE｜U+0036 DIGIT SIX｜U+0037 DIGIT SEVEN｜U+0038 DIGIT EIGHT｜U+0039 DIGIT NINE

在打孔卡上順序列出的1964年EBCDIC的62個字符

```
    _______________________________________________________________
   / &-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/:#@'="¢.<(+|!$*);¬,%_>?
12|  ▊           ▊▊▊▊▊▊▊▊▊                        ▊▊▊▊▊▊
11|   ▊                   ▊▊▊▊▊▊▊▊▊                     ▊▊▊▊▊▊
 0|    ▊                           ▊▊▊▊▊▊▊▊▊                  ▊▊▊▊▊
 1|     ▊        ▊        ▊                ▊
 2|      ▊        ▊        ▊       ▊        ▊     ▊     ▊
 3|       ▊        ▊        ▊       ▊        ▊     ▊     ▊    ▊
 4|        ▊        ▊        ▊       ▊        ▊     ▊     ▊    ▊
 5|         ▊        ▊        ▊       ▊        ▊     ▊     ▊    ▊
 6|          ▊        ▊        ▊       ▊        ▊     ▊     ▊    ▊
 7|           ▊        ▊        ▊       ▊        ▊     ▊     ▊    ▊
 8|            ▊        ▊        ▊       ▊  ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊
 9|             ▊        ▊        ▊       ▊
  |________________________________________________________________
```

```
    _______________________________________________________________
   / 123456789:#@'="&ABCDEFGHI¢.<(+|-JKLMNOPQR!$*);¬0/STUVWXYZ,%_>?
12|                 ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊
11|                                 ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊
 0|                                                 ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊
 1|  ▊               ▊               ▊               ▊
 2|   ▊       ▊       ▊       ▊       ▊       ▊       ▊
 3|    ▊       ▊       ▊       ▊       ▊       ▊       ▊      ▊
 4|     ▊       ▊       ▊       ▊       ▊       ▊       ▊      ▊
 5|      ▊       ▊       ▊       ▊       ▊       ▊       ▊      ▊
 6|       ▊       ▊       ▊       ▊       ▊       ▊       ▊      ▊
 7|        ▊       ▊       ▊       ▊       ▊       ▊       ▊      ▊
 8|         ▊ ▊▊▊▊▊▊        ▊ ▊▊▊▊▊▊        ▊ ▊▊▊▊▊▊        ▊ ▊▊▊▊▊
 9|          ▊               ▊               ▊               ▊
  |________________________________________________________________
```

在處理ASCII可列印字符之時，將其`[`占位`¢`，其`]`占位`!`，其`!`占位（表示邏輯或的）`|`，而其`^`占位（表示邏輯非的）`¬`，並補充上所缺少的屬於ASCII的6個標點符號，成為（不計空白字符在內的）94個可列印字符的編碼表：

0x｜U+0000 NULL｜U+0001 START OF HEADING｜U+0002 START OF TEXT｜U+0003 END OF TEXT｜U+0009 CHARACTER TABULATION｜U+007F DELETE｜U+000B LINE TABULATION｜U+000C FORM FEED (FF)｜U+000D CARRIAGE RETURN (CR)｜U+000E SHIFT OUT｜U+000F SHIFT IN

1x｜U+0010 DATA LINK ESCAPE｜U+0011 DEVICE CONTROL ONE｜U+0012 DEVICE CONTROL TWO｜U+0013 DEVICE CONTROL THREE｜U+0085 NEXT LINE (NEL)｜U+0008 BACKSPACE｜U+0018 CANCEL｜U+0019 END OF MEDIUM｜U+001C INFORMATION SEPARATOR FOUR｜U+001D INFORMATION SEPARATOR THREE｜U+001E INFORMATION SEPARATOR TWO｜U+001F INFORMATION SEPARATOR ONE

2x｜U+000A LINE FEED (LF)｜U+0017 END OF TRANSMISSION BLOCK｜U+001B ESCAPE｜U+0005 ENQUIRY｜U+0006 ACKNOWLEDGE｜U+0007 BELL

3x｜U+0016 SYNCHRONOUS IDLE｜U+0004 END OF TRANSMISSION｜U+0014 DEVICE CONTROL FOUR｜U+0015 NEGATIVE ACKNOWLEDGE｜U+001A SUBSTITUTE

4x｜U+0020 SPACE｜U+005B LEFT SQUARE BRACKET｜U+002E FULL STOP｜U+003C LESS-THAN SIGN｜U+0028 LEFT PARENTHESIS｜U+002B PLUS SIGN｜U+0021 EXCLAMATION MARK

5x｜U+0026 AMPERSAND｜U+005D RIGHT SQUARE BRACKET｜U+0024 DOLLAR SIGN｜U+002A ASTERISK｜U+0029 RIGHT PARENTHESIS｜U+003B SEMICOLON｜U+005E CIRCUMFLEX ACCENT

6x｜U+002D HYPHEN-MINUS｜U+002F SOLIDUS｜U+00A6 BROKEN BAR｜U+002C COMMA｜U+0025 PERCENT SIGN｜U+005F LOW LINE｜U+003E GREATER-THAN SIGN｜U+003F QUESTION MARK

7x｜U+0060 GRAVE ACCENT｜U+003A COLON｜U+0023 NUMBER SIGN｜U+0040 COMMERCIAL AT｜U+0027 APOSTROPHE｜U+003D EQUALS SIGN｜U+0022 QUOTATION MARK

8x｜U+0061 LATIN SMALL LETTER A｜U+0062 LATIN SMALL LETTER B｜U+0063 LATIN SMALL LETTER C｜U+0064 LATIN SMALL LETTER D｜U+0065 LATIN SMALL LETTER E｜U+0066 LATIN SMALL LETTER F｜U+0067 LATIN SMALL LETTER G｜U+0068 LATIN SMALL LETTER H｜U+0069 LATIN SMALL LETTER I

9x｜U+006A LATIN SMALL LETTER J｜U+006B LATIN SMALL LETTER K｜U+006C LATIN SMALL LETTER L｜U+006D LATIN SMALL LETTER M｜U+006E LATIN SMALL LETTER N｜U+006F LATIN SMALL LETTER O｜U+0070 LATIN SMALL LETTER P｜U+0071 LATIN SMALL LETTER Q｜U+0072 LATIN SMALL LETTER R

Ax｜U+007E TILDE｜U+0073 LATIN SMALL LETTER S｜U+0074 LATIN SMALL LETTER T｜U+0075 LATIN SMALL LETTER U｜U+0076 LATIN SMALL LETTER V｜U+0077 LATIN SMALL LETTER W｜U+0078 LATIN SMALL LETTER X｜U+0079 LATIN SMALL LETTER Y｜U+007A LATIN SMALL LETTER Z

Bx｜U+005E CIRCUMFLEX ACCENT｜U+005B LEFT SQUARE BRACKET｜U+005D RIGHT SQUARE BRACKET

Cx｜U+0041 LATIN CAPITAL LETTER A｜U+0042 LATIN CAPITAL LETTER B｜U+0043 LATIN CAPITAL LETTER C｜U+0044 LATIN CAPITAL LETTER D｜U+0045 LATIN CAPITAL LETTER E｜U+0046 LATIN CAPITAL LETTER F｜U+0047 LATIN CAPITAL LETTER G｜U+0048 LATIN CAPITAL LETTER H｜U+0049 LATIN CAPITAL LETTER I

Dx｜U+004A LATIN CAPITAL LETTER J｜U+004B LATIN CAPITAL LETTER K｜U+004C LATIN CAPITAL LETTER L｜U+004D LATIN CAPITAL LETTER M｜U+004E LATIN CAPITAL LETTER N｜U+004F LATIN CAPITAL LETTER O｜U+0050 LATIN CAPITAL LETTER P｜U+0051 LATIN CAPITAL LETTER Q｜U+0052 LATIN CAPITAL LETTER R

Ex｜U+005C REVERSE SOLIDUS｜U+0053 LATIN CAPITAL LETTER S｜U+0054 LATIN CAPITAL LETTER T｜U+0055 LATIN CAPITAL LETTER U｜U+0056 LATIN CAPITAL LETTER V｜U+0057 LATIN CAPITAL LETTER W｜U+0058 LATIN CAPITAL LETTER X｜U+0059 LATIN CAPITAL LETTER Y｜U+005A LATIN CAPITAL LETTER Z

Fx｜U+0030 DIGIT ZERO｜U+0031 DIGIT ONE｜U+0032 DIGIT TWO｜U+0033 DIGIT THREE｜U+0034 DIGIT FOUR｜U+0035 DIGIT FIVE｜U+0036 DIGIT SIX｜U+0037 DIGIT SEVEN｜U+0038 DIGIT EIGHT｜U+0039 DIGIT NINE

在後來代碼頁版本的EBCDIC中，定義了「不變子集」58個字符，即在62個可列印字符子集基礎上再去掉4個被占用了字符，並且計空白字符而不計`$`在內，如下圖灰色底所示。然後於各版本的編碼表中，加入了其他字符，以符合各地使用者所需。

以下是其中兩個版本的EBCDIC編碼表：CP037（英語）及CP500（多語言#5）。CP037為ASCII的`[`、`]`和`^`重新指定了位置不再占用EBCDIC的`¢`、`!`和`¬`，將其`!`認同為原來EBCDIC的`!`。CP500為被占用的EBCDIC的`¢`、`|`和`¬`重新指定了位置，將EBCDIC的`!`認同為占用了其位置的`!`。

EBCDIC CP037

x0｜x1｜x2｜x3｜x4｜x5｜x6｜x7｜x8｜x9｜xA｜xB｜xC｜xD｜xE｜xF

0x｜NUL｜SOH｜STX｜ETX｜ST｜HT｜SSA｜DEL｜EPA｜RI｜SS2｜VT｜FF｜CR｜SO｜SI

1x｜DLE｜DC1｜DC2｜DC3｜OSC｜NEL｜BS｜ESA｜CAN｜EM｜PU2｜SS3｜FS｜GS｜RS｜US

2x｜PAD｜HOP｜BPH｜NBH｜IND｜LF｜ETB｜ESC｜HTS｜HTJ｜VTS｜PLD｜PLU｜ENQ｜ACK｜BEL

3x｜DCS｜PU1｜SYN｜STS｜CCH｜MW｜SPA｜EOT｜SOS｜SGCI｜SCI｜CSI｜DC4｜NAK｜PM｜SUB

4x｜SP｜NBSP｜â｜ä｜à｜á｜ã｜å｜ç｜ñ｜¢｜.｜<｜(｜+｜|

5x｜&｜é｜ê｜ë｜è｜í｜î｜ï｜ì｜ß｜$｜、｜)｜;｜¬

6x｜/｜Â｜Ä｜À｜Á｜Ã｜Å｜Ç｜Ñ｜¦｜,｜%｜_｜>｜?

7x｜ø｜É｜Ê｜Ë｜È｜Í｜Î｜Ï｜Ì｜`｜:｜#｜@｜'｜=｜"

8x｜Ø｜a｜b｜c｜d｜e｜f｜g｜h｜i｜«｜»｜ð｜ý｜þ｜±

9x｜°｜j｜k｜l｜m｜n｜o｜p｜q｜r｜ª｜º｜æ｜¸｜Æ｜¤

Ax｜µ｜~｜s｜t｜u｜v｜w｜x｜y｜z｜¡｜¿｜Ð｜Ý｜Þ｜®

Bx｜^｜£｜¥｜·｜©｜§｜¶｜¼｜½｜¾｜¯｜¨｜´｜×

Cx｜`{`｜A｜B｜C｜D｜E｜F｜G｜H｜I｜SHY｜ô｜ö｜ò｜ó｜õ

Dx｜`}`｜J｜K｜L｜M｜N｜O｜P｜Q｜R｜¹｜û｜ü｜ù｜ú｜ÿ

Ex｜\｜÷｜S｜T｜U｜V｜W｜X｜Y｜Z｜²｜Ô｜Ö｜Ò｜Ó｜Õ

Fx｜0｜1｜2｜3｜4｜5｜6｜7｜8｜9｜³｜Û｜Ü｜Ù｜Ú｜APC

EBCDIC CP500

x0｜x1｜x2｜x3｜x4｜x5｜x6｜x7｜x8｜x9｜xA｜xB｜xC｜xD｜xE｜xF

0x｜NUL｜SOH｜STX｜ETX｜ST｜HT｜SSA｜DEL｜EPA｜RI｜SS2｜VT｜FF｜CR｜SO｜SI

1x｜DLE｜DC1｜DC2｜DC3｜OSC｜NEL｜BS｜ESA｜CAN｜EM｜PU2｜SS3｜FS｜GS｜RS｜US

2x｜PAD｜HOP｜BPH｜NBH｜IND｜LF｜ETB｜ESC｜HTS｜HTJ｜VTS｜PLD｜PLU｜ENQ｜ACK｜BEL

3x｜DCS｜PU1｜SYN｜STS｜CCH｜MW｜SPA｜EOT｜SOS｜SGCI｜SCI｜CSI｜DC4｜NAK｜PM｜SUB

4x｜SP｜NBSP｜â｜ä｜à｜á｜ã｜å｜ç｜ñ｜.｜<｜(｜+

5x｜&｜é｜ê｜ë｜è｜í｜î｜ï｜ì｜ß｜$｜、｜)｜;｜^

6x｜/｜Â｜Ä｜À｜Á｜Ã｜Å｜Ç｜Ñ｜¦｜,｜%｜_｜>｜?

7x｜ø｜É｜Ê｜Ë｜È｜Í｜Î｜Ï｜Ì｜`｜:｜#｜@｜'｜=｜"

8x｜Ø｜a｜b｜c｜d｜e｜f｜g｜h｜i｜«｜»｜ð｜ý｜þ｜±

9x｜°｜j｜k｜l｜m｜n｜o｜p｜q｜r｜ª｜º｜æ｜¸｜Æ｜¤

Ax｜µ｜~｜s｜t｜u｜v｜w｜x｜y｜z｜¡｜¿｜Ð｜Ý｜Þ｜®

Cx｜`{`｜A｜B｜C｜D｜E｜F｜G｜H｜I｜SHY｜ô｜ö｜ò｜ó｜õ

Dx｜`}`｜J｜K｜L｜M｜N｜O｜P｜Q｜R｜¹｜û｜ü｜ù｜ú｜ÿ

Ex｜\｜÷｜S｜T｜U｜V｜W｜X｜Y｜Z｜²｜Ô｜Ö｜Ò｜Ó｜Õ

Fx｜0｜1｜2｜3｜4｜5｜6｜7｜8｜9｜³｜Û｜Ü｜Ù｜Ú｜APC

於編碼表中，0x00 - 0x3F及0xFF為控制字元，0x40為空格，0x41為不換行空格（no-break space），0xCA為選擇性連字號（soft hyphen）。

## 外部連結

- F.0 Appendix F. Code Pages from AS/400 International Application Development V4R2
- ICU Character Mapping Tables 包含EBCDIC與Unicode的對應表
- LegacyJ- EBCDIC Table
- Computer Character Set Table
- Unicode Technical Report #16: UTF-EBCDICI