/ 写在前面 – 我热爱技术、热爱开源。我也相信开源能使技术变得更好、共享能使知识传播得更远。但是开源并不意味着某些商业机构/个人可以为了自身的利益而一味地索取,甚至直接剽窃大家曾为之辛勤付出的知识成果,所以本文未经允许,不得转载,谢谢/


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.

  1. Dec = Decimal Value
  2. Hex = Hexadecimal Value
  3. Char = Character
  4. '5' has the int value 53.
  5. If we write '5'-'0' it evaluates to 53-48, or the int 5.
  6. If we write char c = 'B'+32, then c stores 'b'.

High Frequency

  1. Dec Hex Char
  2. ---------------
  3. 10 A LF
  4. 13 D CR
  5. 32 20 SPACE
  6. 48 30 0
  7. 65 41 A
  8. 90 5A Z
  9. 97 61 a
  10. 122 7A z

All

  1. Dec Hex Char Dec Hex Char Dec Hex Char Dec Hex Char
  2. --------------- --------------- --------------- ---------------
  3. 0 0 NUL (null) 32 20 SPACE 64 40 @ 96 60 `
  4. 1 1 SOH (start of heading) 33 21 ! 65 41 A 97 61 a
  5. 2 2 STX (start of text) 34 22 " 66 42 B 98 62 b
  6. 3 3 ETX (end of text) 35 23 # 67 43 C 99 63 c
  7. 4 4 EOT (end of transmission) 36 24 $ 68 44 D 100 64 d
  8. 5 5 ENQ (enquiry) 37 25 % 69 45 E 101 65 e
  9. 6 6 ACK (acknowledge) 38 26 & 70 46 F 102 66 f
  10. 7 7 BEL (bell) 39 27 ' 71 47 G 103 67 g
  11. 8 8 BS (backspace) 40 28 ( 72 48 H 104 68 h
  12. 9 9 TAB (horizontal tab) 41 29 ) 73 49 I 105 69 i
  13. 10 A LF (NL line feed, new line) 42 2A * 74 4A J 106 6A j
  14. 11 B VT (vertical tab) 43 2B + 75 4B K 107 6B k
  15. 12 C FF (NP form feed, new page) 44 2C , 76 4C L 108 6C l
  16. 13 D CR (carriage return) 45 2D - 77 4D M 109 6D m
  17. 14 E SO (shift out) 46 2E . 78 4E N 110 6E n
  18. 15 F SI (shift in) 47 2F / 79 4F O 111 6F o
  19. 16 10 DLE (data link escape) 48 30 0 80 50 P 112 70 p
  20. 17 11 DC1 (device control 1) 49 31 1 81 51 Q 113 71 q
  21. 18 12 DC2 (device control 2) 50 32 2 82 52 R 114 72 r
  22. 19 13 DC3 (device control 3) 51 33 3 83 53 S 115 73 s
  23. 20 14 DC4 (device control 4) 52 34 4 84 54 T 116 74 t
  24. 21 15 NAK (negative acknowledge) 53 35 5 85 55 U 117 75 u
  25. 22 16 SYN (synchronous idle) 54 36 6 86 56 V 118 76 v
  26. 23 17 ETB (end of trans. block) 55 37 7 87 57 W 119 77 w
  27. 24 18 CAN (cancel) 56 38 8 88 58 X 120 78 x
  28. 25 19 EM (end of medium) 57 39 9 89 59 Y 121 79 y
  29. 26 1A SUB (substitute) 58 3A : 90 5A Z 122 7A z
  30. 27 1B ESC (escape) 59 3B ; 91 5B [ 123 7B {
  31. 28 1C FS (file separator) 60 3C < 92 5C \ 124 7C |
  32. 29 1D GS (group separator) 61 3D = 93 5D ] 125 7D }
  33. 30 1E RS (record separator) 62 3E > 94 5E ^ 126 7E ~
  34. 31 1F US (unit separator) 63 3F ? 95 5F _ 127 7F DEL