ASCII 控制字符
美国标准资讯交换标准码 ASCII 码中特殊的符号,电脑称为控制字符 Control Characters 并不代表任何可见的字符,而是用来控制电脑输出设备的行为。ASCII 用于电脑和通讯设备的编码系统,它将每个英文字母、数字和标点符号等符号,对应个七位元的 Binary Digit 二进位数字介于 0 到 127 的十进位数字。例如大写字母 A 的 ASCII 码是 65,小写字母 a 的 ASCII 码是 97,数字 0 的 ASCII 码是 48 等等。ASCII 为 American Standard Code for Information Interchange 的缩写。ASCII 编码是美国标准资讯交换标准码,计算机资讯传输的一种编码方式。
ASCII 定义了 256 个代码 (0~255)
Dec 对照 Decimal 十进位 0~31 控制字符 ASCII Control Characters
Dec 对照 Decimal 十进位 32~127 可列印字符 ASCII Printable Characters
Dec 对照 Decimal 十进位 0~127 标准的 ASCII 编码, 128~255 为扩展的 ASCII 编码
较常用控制字符、十进位 0~31
| Char | Oct | Dec | Hex | Ctrl-Key | 控制动作 |
|---|---|---|---|---|---|
| NUL | 0 | 0 | 0 | ^@ | 空字元 Null character |
| SOH | 1 | 1 | 1 | ^A | 标题开始 Start of heading |
| STX | 2 | 2 | 2 | ^B | 本文开始 Start of text |
| ETX | 3 | 3 | 3 | ^C | 本文结束 End of text |
| EOT | 4 | 4 | 4 | ^D | 传输结束 End of Submission, 不同于 ETB |
| ENQ | 5 | 5 | 5 | ^E | 请求查询 Enquiry, 与 ACK 一起使用 |
| ACK | 6 | 6 | 6 | ^F | 确认回应 Acknowledge, 清除 ENQ 请求查询 |
| BEL | 7 | 7 | 7 | ^G | 铃声 Bell, Rings Bell... |
| BS | 10 | 8 | 8 | ^H | 退格 Backspace, Delete 删除字元键 |
| HT | 11 | 9 | 9 | ^I | 水平定位符号 Tab 空格键 Horizontal tab |
| LF | 12 | 10 | a | ^J | 换行键 Line Feed CHR(10) |
| VT | 13 | 11 | b | ^K | 直定位符号 Vertical tab |
| FF | 14 | 12 | c | ^L | 换页键 Form Feed, page eject |
| CR | 15 | 13 | d | ^M | 回车 [Enter] Carriage Return CHR(13) |
| SO | 16 | 14 | e | ^N | 取消变换 Shift Out, 替代字符集 |
| SI | 17 | 15 | f | ^O | 启用变换 Shift In, 恢復默认字符集 |
| DLE | 20 | 16 | 10 | ^P | 跳出资料通讯 Data link escape |
| DC1 | 21 | 17 | 11 | ^Q | 设备控制一 Device control 1 (XON) |
| DC2 | 22 | 18 | 12 | ^R | 设备控制二 Device control 2 |
| DC3 | 23 | 19 | 13 | ^S | 设备控制三 Device control 3 (XOFF) |
| DC4 | 24 | 20 | 14 | ^T | 设备控制四 Device control 4 |
| NAK | 25 | 21 | 15 | ^U | 否定失败回应 Negative acknowledge |
| SYN | 26 | 22 | 16 | ^V | 同步用暂停 Synchronous idle |
| ETB | 27 | 23 | 17 | ^W | 区块传输结束 End Submission block, 与 EOT 不同 |
| CAN | 30 | 24 | 17 | ^X | 取消 Cancel line |
| EM | 31 | 25 | 19 | ^Y | 连线媒介中断 End of medium, Ctrl + Y 中断 |
| SUB | 32 | 26 | 1a | ^Z | 替代字符 Substitute |
| ESC | 33 | 27 | 1b | ^[ | 退出键 Escape, Esc |
| FS | 34 | 28 | 1c | ^\ | 档案分割符 File Separator |
| GS | 35 | 29 | 1d | ^] | 群组分隔符 Group Separator |
| RS | 36 | 30 | 1e | ^^ | 记录分隔符 Record Separator, 块模终止符 |
| US | 37 | 31 | 1f | ^_ | 单元分隔符 Unit Separator |
ASCII 标准字符、十进位 32~127 编码
| Char (字符) | 八进位 Octal | 十进位 Dec | 十六进位 Hex | 描述 Description |
|---|---|---|---|---|
| SP | 40 | 32 | 20 | Space |
| ! | 41 | 33 | 21 | Exclamation mark |
| " | 42 | 34 | 22 | Quotation mark ( " in HTML) |
| # | 43 | 35 | 23 | Cross hatch (number sign) |
| $ | 44 | 36 | 24 | Dollar sign |
| % | 45 | 37 | 25 | Percent sign |
| & | 46 | 38 | 26 | Ampersand |
| ` | 47 | 39 | 27 | Closing single quote (apostrophe) |
| ( | 50 | 40 | 28 | Opening parentheses |
| ) | 51 | 41 | 29 | Closing parentheses |
| * | 52 | 42 | 2a | Asterisk (star, multiply) |
| + | 53 | 43 | 2b | Plus |
| , | 54 | 44 | 2c | Comma |
| - | 55 | 45 | 2d | Hyphen, dash, minus |
| . | 56 | 46 | 2e | Period |
| / | 57 | 47 | 2f | Slant (forward slash, divide) |
| 0 | 60 | 48 | 30 | Zero |
| 1 | 61 | 49 | 31 | One |
| 2 | 62 | 50 | 32 | Two |
| 3 | 63 | 51 | 33 | Three |
| 4 | 64 | 52 | 34 | Four |
| 5 | 65 | 53 | 35 | Five |
| 6 | 66 | 54 | 36 | Six |
| 7 | 67 | 55 | 37 | Seven |
| 8 | 70 | 56 | 38 | Eight |
| 9 | 71 | 57 | 39 | Nine |
| : | 72 | 58 | 3a | Colon |
| ; | 73 | 59 | 3b | Semicolon |
| < | 74 | 60 | 3c | Less than sign (< in HTML) |
| = | 75 | 61 | 3d | Equals sign |
| > | 76 | 62 | 3e | Greater than sign (> in HTML) |
| ? | 77 | 63 | 3f | Question mark |
| @ | 100 | 64 | 40 | At-sign |
| A | 101 | 65 | 41 | Uppercase A |
| B | 102 | 66 | 42 | Uppercase B |
| C | 103 | 67 | 43 | Uppercase C |
| D | 104 | 68 | 44 | Uppercase D |
| E | 105 | 69 | 45 | Uppercase E |
| F | 106 | 70 | 46 | Uppercase F |
| G | 107 | 71 | 47 | Uppercase G |
| H | 110 | 72 | 48 | Uppercase H |
| I | 111 | 73 | 49 | Uppercase I |
| J | 112 | 74 | 4a | Uppercase J |
| K | 113 | 75 | 4b | Uppercase K |
| L | 114 | 76 | 4c | Uppercase L |
| M | 115 | 77 | 4d | Uppercase M |
| N | 116 | 78 | 4e | Uppercase N |
| O | 117 | 79 | 4f | Uppercase O |
| P | 120 | 80 | 50 | Uppercase P |
| Q | 121 | 81 | 51 | Uppercase Q |
| R | 122 | 82 | 52 | Uppercase R |
| S | 123 | 83 | 53 | Uppercase S |
| T | 124 | 84 | 54 | Uppercase T |
| U | 125 | 85 | 55 | Uppercase U |
| V | 126 | 86 | 56 | Uppercase V |
| W | 127 | 87 | 57 | Uppercase W |
| X | 130 | 88 | 58 | Uppercase X |
| Y | 131 | 89 | 59 | Uppercase Y |
| Z | 132 | 90 | 5a | Uppercase Z |
| [ | 133 | 91 | 5b | Opening square bracket |
| \ | 134 | 92 | 5c | Reverse slant (Backslash) |
| ] | 135 | 93 | 5d | Closing square bracket |
| ^ | 136 | 94 | 5e | Caret (Circumflex) |
| _ | 137 | 95 | 5f | Underscore |
| ` | 140 | 96 | 60 | Opening single quote |
| a | 141 | 97 | 61 | Lowercase a |
| b | 142 | 98 | 62 | Lowercase b |
| c | 143 | 99 | 63 | Lowercase c |
| d | 144 | 100 | 64 | Lowercase d |
| e | 145 | 101 | 65 | Lowercase e |
| f | 146 | 102 | 66 | Lowercase f |
| g | 147 | 103 | 67 | Lowercase g |
| h | 150 | 104 | 68 | Lowercase h |
| i | 151 | 105 | 69 | Lowercase i |
| j | 152 | 106 | 6a | Lowercase j |
| k | 153 | 107 | 6b | Lowercase k |
| l | 154 | 108 | 6c | Lowercase l |
| m | 155 | 109 | 6d | Lowercase m |
| n | 156 | 110 | 6e | Lowercase n |
| o | 157 | 111 | 6f | Lowercase o |
| p | 160 | 112 | 70 | Lowercase p |
| q | 161 | 113 | 71 | Lowercase q |
| r | 162 | 114 | 72 | Lowercase r |
| s | 163 | 115 | 73 | Lowercase s |
| t | 164 | 116 | 74 | Lowercase t |
| u | 165 | 117 | 75 | Lowercase u |
| v | 166 | 118 | 76 | Lowercase v |
| w | 167 | 119 | 77 | Lowercase w |
| x | 170 | 120 | 78 | Lowercase x |
| y | 171 | 121 | 79 | Lowercase y |
| z | 172 | 122 | 7a | Lowercase z |
| { | 173 | 123 | 7b | Opening curly brace |
| | | 174 | 124 | 7c | Vertical line |
| } | 175 | 125 | 7d | Closing curly brace |
| ~ | 176 | 126 | 7e | Tilde (approximate) |
| DEL | 177 | 127 | 7f | Delete (rubout), cross-hatch box |
资讯交换码
标准资讯交换码,互联网 Internet 号码分配机构 IANA 使用现代名称 US-ASCII。通过这种方式使用统一、字符处理、字符保存、通信和印刷通用符号,ASCII 主要用于网路讯息间传递、电子通信的字符编码标准、最初定义基于英文字母表 0~127 将 128 个字符编码为 7 位整数之信息交换标准代码。包括 32 个非打印控制用字符、加上 95 个可显示编码字符,数字 0-9 和小写字母 a-z 和大写字母 A-Z 以及标点符号和可显示列印符号。
ASCII 扩展字符 128~255
| Char (字符) | 八进位 Octal | 十进位 Dec | 十六进位 Hex | 描述 Description |
|---|---|---|---|---|
| Ç | 200 | 128 | 80 | Majuscule C-cedilla |
| ü | 201 | 129 | 81 | Letter u with Umlaut or Diuresis, u-umlaut |
| é | 202 | 130 | 82 | Letter e with Acute accent or e-acute |
| â | 203 | 131 | 83 | Letter a with Circumflex accent or a-circumflex |
| ä | 204 | 132 | 84 | Letter a with Umlaut or diuresis, a-umlaut |
| à | 205 | 133 | 85 | Letter a with Grave accent |
| å | 206 | 134 | 86 | Letter a with a Ring |
| ç | 207 | 135 | 87 | Minuscule C-Cedilla |
| ê | 210 | 136 | 88 | Letter e with Circumflex accent or e-circumflex |
| ë | 211 | 137 | 89 | Letter e with Umlaut or diuresis, e-umlauts |
| è | 212 | 138 | 8a | Letter e with Grave accent |
| ï | 213 | 139 | 8b | Letter i with Umlaut or diuresis, i-umlaut |
| î | 214 | 140 | 8c | Letter i with Circumflex accent or i-circumflex |
| ì | 215 | 141 | 8d | Letter i with Grave accent |
| Ä | 216 | 142 | 8e | Letter A with Umlaut or Diuresis, A-umlaut |
| Å | 217 | 143 | 8f | Capital letter A with a ring |
| É | 220 | 144 | 90 | Capital letter E with acute accent or E-acute |
| æ | 221 | 145 | 91 | Latin Diphthong AE in lowercase |
| Æ | 222 | 146 | 92 | Latin Diphthong AE in uppercase |
| ô | 223 | 147 | 93 | Letter o with Circumflex accent or o-circumflex |
| ö | 224 | 148 | 94 | Letter o with Umlaut or diuresis, o-umlaut |
| ò | 225 | 149 | 95 | Letter o with Grave accent |
| û | 226 | 150 | 96 | Letter u with Circumflex accent or u-circumflex |
| ù | 227 | 151 | 97 | Letter u with Grave accent |
| ÿ | 230 | 152 | 98 | Lowercase Letter Y with diuresis |
| Ö | 231 | 153 | 99 | Letter O with Umlaut or diuresis, O-umlaut |
| Ü | 232 | 154 | 9a | Letter U with Umlaut or diuresis, U-umlaut |
| ø | 233 | 155 | 9b | Lowercase Slashed zero or empty set |
| £ | 234 | 156 | 9c | Pound sign, Symbol for the pound sterling |
| Ø | 235 | 157 | 9d | Uppercase slashed zero or empty set |
| × | 236 | 158 | 9e | Multiplication sign |
| ƒ | 237 | 159 | 9f | Function sign, F with hook sign, florin sign |
| á | 240 | 160 | a0 | Lowercase Letter a with acute accent or a-acute |
| í | 241 | 161 | a1 | Lowercase Letter i with acute accent or i-acute |
| ó | 242 | 162 | a2 | Lowercase Letter o with acute accent or o-acute |
| ú | 243 | 163 | a3 | Lowercase Letter u with acute accent or u-acute |
| ñ | 244 | 164 | a4 | Enie, eñe, spanish letter, lowercase n with tilde |
| Ñ | 245 | 165 | a5 | Spanish letter, uppercase N with tilde, EÑE |
| ª | 246 | 166 | a6 | Feminine ordinal indicator |
| º | 247 | 167 | a7 | Masculine ordinal indicator |
| ¿ | 250 | 168 | a8 | Inverted question marks |
| ® | 251 | 169 | a9 | Registered trademark symbol |
| ¬ | 252 | 170 | aa | Logical negation symbol |
| ½ | 253 | 171 | ab | One half |
| ¼ | 254 | 172 | ac | Quarter, one fourth |
| ¡ | 255 | 173 | ad | Inverted exclamation marks |
| « | 256 | 174 | ae | Angle quotes, guillemets, right-pointing quotation mark |
| » | 257 | 175 | af | Guillemets, angle quotes, left-pointing quotation marks |
| ░ | 260 | 176 | b0 | Graphic character, low density dotted |
| ▒ | 261 | 177 | b1 | Graphic character, medium density dotted |
| ▓ | 262 | 178 | b2 | Graphic character, high density dotted |
| │ | 263 | 179 | b3 | Box drawing character single vertical line |
| ┤ | 264 | 180 | b4 | Box drawing character single vertical and left line |
| Á | 265 | 181 | b5 | Capital letter A with acute accent or A-acute |
| Â | 266 | 182 | b6 | Letter A with circumflex accent or A-circumflex |
| À | 267 | 183 | b7 | Letter A with grave accent |
| © | 270 | 184 | b8 | Copyright symbol |
| ╣ | 271 | 185 | b9 | Box drawing character double line vertical and left |
| ║ | 272 | 186 | ba | Box drawing character double vertical line |
| ╗ | 273 | 187 | bb | Box drawing character double line upper right corner |
| ╝ | 274 | 188 | bc | Box drawing character double line lower right corner |
| ¢ | 275 | 189 | bd | Cent symbol |
| ¥ | 276 | 190 | be | YEN and YUAN sign |
| ┐ | 277 | 191 | bf | Box drawing character single line upper right corner |
| └ | 300 | 192 | c0 | Box drawing character single line lower left corner |
| ┴ | 301 | 193 | c1 | Box drawing character single line horizontal and up |
| ┬ | 302 | 194 | c2 | Box drawing character single line horizontal down |
| ├ | 303 | 195 | c3 | Box drawing character single line vertical and right |
| ─ | 304 | 196 | c4 | Box drawing character single horizontal line |
| ┼ | 305 | 197 | c5 | Box drawing character single line horizontal vertical |
| ã | 306 | 198 | c6 | Lowercase letter a with tilde or a-tilde |
| Ã | 307 | 199 | c7 | Capital letter A with tilde or A-tilde |
| ╚ | 310 | 200 | c8 | Box drawing character double line lower left corner |
| ╔ | 311 | 201 | c9 | Box drawing character double line upper left corner |
| ╩ | 312 | 202 | ca | Box drawing character double line horizontal and up |
| ╦ | 313 | 203 | cb | Box drawing character double line horizontal down |
| ╠ | 314 | 204 | cc | Box drawing character double line vertical and right |
| ═ | 315 | 205 | cd | Box drawing character double horizontal line |
| ╬ | 316 | 206 | ce | Box drawing character double line horizontal vertical |
| ¤ | 317 | 207 | cf | Generic currency sign |
| ð | 320 | 208 | d0 | Lowercase letter eth |
| Ð | 321 | 209 | d1 | Capital letter Eth |
| Ê | 322 | 210 | d2 | Letter E with circumflex accent or E-circumflex |
| Ë | 323 | 211 | d3 | Letter E with umlaut or diuresis, E-umlaut |
| È | 324 | 212 | d4 | Capital letter E with grave accent |
| ı | 325 | 213 | d5 | Lowercase dot less i |
| Í | 326 | 214 | d6 | Capital letter I with acute accent or I-acute |
| Î | 327 | 215 | d7 | Letter I with circumflex accent or I-circumflex |
| Ï | 330 | 216 | d8 | Letter I with umlaut or diuresis, I-umlaut |
| ┘ | 331 | 217 | d9 | Box drawing character single line lower right corner |
| ┌ | 332 | 218 | da | Box drawing character single line upper left corner |
| █ | 333 | 219 | db | Block, graphic character |
| ▄ | 334 | 220 | dc | Bottom half block |
| ¦ | 335 | 221 | dd | Vertical broken bar |
| Ì | 336 | 222 | de | Capital letter I with grave accent |
| ▀ | 337 | 223 | df | Top half block |
| Ó | 340 | 224 | e0 | Capital letter O with acute accent or O-acute |
| ß | 341 | 225 | e1 | Letter Eszett, scharfes S or sharp S |
| Ô | 342 | 226 | e2 | Letter O with circumflex accent or O-circumflex |
| Ò | 343 | 227 | e3 | Capital letter O with grave accent |
| õ | 344 | 228 | e4 | Lowercase letter o with tilde or o-tilde |
| Õ | 345 | 229 | e5 | Capital letter O with tilde or O-tilde |
| µ | 346 | 230 | e6 | Lowercase letter Mu, micro sign or micron |
| þ | 347 | 231 | e7 | Lowercase letter Thorn |
| Þ | 350 | 232 | e8 | Capital letter Thorn |
| Ú | 351 | 233 | e9 | Capital letter U with acute accent or U-acute |
| Û | 352 | 234 | ea | Letter U with circumflex accent or U-circumflex |
| Ù | 353 | 235 | eb | Capital letter U with grave accent |
| ý | 354 | 236 | ec | Lowercase letter y with acute accent |
| Ý | 355 | 237 | ed | Capital letter Y with acute accent |
| ¯ | 356 | 238 | ee | Macron symbol |
| ´ | 357 | 239 | ef | Acute accent |
| ≡ | 360 | 240 | f0 | Congruence relation symbol |
| ± | 361 | 241 | f1 | Plus-minus sign |
| ‗ | 362 | 242 | f2 | underline or underscore |
| ¾ | 363 | 243 | f3 | three quarters, three-fourths |
| ¶ | 364 | 244 | f4 | Paragraph sign or pilcrow, end paragraph mark |
| § | 365 | 245 | f5 | Section sign |
| ÷ | 366 | 246 | f6 | The division sign, Obelus |
| ¸ | 367 | 247 | f7 | cedilla |
| ° | 370 | 248 | f8 | Degree symbol |
| ¨ | 371 | 249 | f9 | Diaresis |
| · | 372 | 250 | fa | Interpunct or space dot |
| ¹ | 373 | 251 | fb | Superscript one, exponent 1, first power |
| ³ | 374 | 252 | fc | Superscript three, exponent 3, cube, third power |
| ² | 375 | 253 | fd | Superscript two, exponent 2, square, second power |
| ■ | 376 | 254 | fe | black square |
| | 377 | 255 | ff | Non-breaking space or no-break space |