/ 写在前面 – 我热爱技术、热爱开源。我也相信开源能使技术变得更好、共享能使知识传播得更远。但是开源并不意味着某些商业机构/个人可以为了自身的利益而一味地索取,甚至直接剽窃大家曾为之辛勤付出的知识成果,所以本文未经允许,不得转载,谢谢。/
Introduction
ASCII stands for American Standard Code for Information Interchange. Below is the ASCII character table, including descriptions of the first 32 characters. ASCII was originally designed for use with teletypes, and so the descriptions are somewhat obscure and their use is frequently not as intended.
Java actually uses Unicode, which includes ASCII and other characters from languages around the world.
Dec = Decimal ValueHex = Hexadecimal ValueChar = Character'5' has the int value 53.If we write '5'-'0' it evaluates to 53-48, or the int 5.If we write char c = 'B'+32, then c stores 'b'.
High Frequency
Dec Hex Char---------------10 A LF13 D CR32 20 SPACE48 30 065 41 A90 5A Z97 61 a122 7A z
All
Dec Hex Char Dec Hex Char Dec Hex Char Dec Hex Char--------------- --------------- --------------- ---------------0 0 NUL (null) 32 20 SPACE 64 40 @ 96 60 `1 1 SOH (start of heading) 33 21 ! 65 41 A 97 61 a2 2 STX (start of text) 34 22 " 66 42 B 98 62 b3 3 ETX (end of text) 35 23 # 67 43 C 99 63 c4 4 EOT (end of transmission) 36 24 $ 68 44 D 100 64 d5 5 ENQ (enquiry) 37 25 % 69 45 E 101 65 e6 6 ACK (acknowledge) 38 26 & 70 46 F 102 66 f7 7 BEL (bell) 39 27 ' 71 47 G 103 67 g8 8 BS (backspace) 40 28 ( 72 48 H 104 68 h9 9 TAB (horizontal tab) 41 29 ) 73 49 I 105 69 i10 A LF (NL line feed, new line) 42 2A * 74 4A J 106 6A j11 B VT (vertical tab) 43 2B + 75 4B K 107 6B k12 C FF (NP form feed, new page) 44 2C , 76 4C L 108 6C l13 D CR (carriage return) 45 2D - 77 4D M 109 6D m14 E SO (shift out) 46 2E . 78 4E N 110 6E n15 F SI (shift in) 47 2F / 79 4F O 111 6F o16 10 DLE (data link escape) 48 30 0 80 50 P 112 70 p17 11 DC1 (device control 1) 49 31 1 81 51 Q 113 71 q18 12 DC2 (device control 2) 50 32 2 82 52 R 114 72 r19 13 DC3 (device control 3) 51 33 3 83 53 S 115 73 s20 14 DC4 (device control 4) 52 34 4 84 54 T 116 74 t21 15 NAK (negative acknowledge) 53 35 5 85 55 U 117 75 u22 16 SYN (synchronous idle) 54 36 6 86 56 V 118 76 v23 17 ETB (end of trans. block) 55 37 7 87 57 W 119 77 w24 18 CAN (cancel) 56 38 8 88 58 X 120 78 x25 19 EM (end of medium) 57 39 9 89 59 Y 121 79 y26 1A SUB (substitute) 58 3A : 90 5A Z 122 7A z27 1B ESC (escape) 59 3B ; 91 5B [ 123 7B {28 1C FS (file separator) 60 3C < 92 5C \ 124 7C |29 1D GS (group separator) 61 3D = 93 5D ] 125 7D }30 1E RS (record separator) 62 3E > 94 5E ^ 126 7E ~31 1F US (unit separator) 63 3F ? 95 5F _ 127 7F DEL
