Character set and ASCII Table

Character Set:

A character set, often referred to as a character encoding or character repertoire, is a defined collection of characters, symbols, and control codes used to represent textual information in a computer or communication system. It specifies how characters are mapped to numerical values (usually binary) so that computers can store, transmit, and display text.

ASCII Table:

The ASCII (American Standard Code for Information Interchange) table is one of the most well-known character sets and encoding standards. ASCII was developed in the early days of computing to provide a standardized way to represent characters in computers and communication equipment. The ASCII table assigns numerical values (integers) to a set of 128 characters, including letters, digits, punctuation marks, control codes, and special symbols. Each character is represented by a 7-bit binary code (0 to 127).

Here's an illustration of the ASCII table in detail, organized into several categories:

  1. Control Characters (0-31):
    • These characters are non-printable and used for control purposes, such as carriage return, line feed, and escape sequences.
    • Examples: NUL (Null), CR (Carriage Return), LF (Line Feed), TAB (Tabulation), ESC (Escape).
  2. Basic Latin (32-127):
    • This range includes common printable characters, including uppercase and lowercase letters, digits, punctuation marks, and some special symbols.
    • Examples: 'A' to 'Z', 'a' to 'z', '0' to '9', '!', '@', '#', '$', '%', etc.
  3. Extended ASCII (128-255):
    • Extended ASCII characters vary depending on specific implementations and locales.
    • In the standard ASCII table, these codes are not defined consistently. However, some common extended ASCII sets include characters for different languages, symbols, and graphics.
    • Examples: Accented letters, currency symbols, box-drawing characters, etc.
  4. Control Characters (128-255):
    • Some control codes and special characters are also found in the extended ASCII range.
    • Examples: Latin-1 Supplement characters, such as © (Copyright), ® (Registered Trademark), and others.

Here's a simplified representation of the ASCII table:


----------------------------------------------------------------
|  0- 31 | Control Characters          |  32- 63 | Punctuation   |
|----------------------------------------------------------------|
|  32- 63 | Basic Latin (printable)    |  64- 95 | Punctuation   |
|----------------------------------------------------------------|
|  64- 95 | Basic Latin (printable)    |  96-127 | Punctuation   |
|----------------------------------------------------------------|
| 128-159 | Extended ASCII (varies)    | 160-191 | Extended      |
|----------------------------------------------------------------|
| 160-191 | Extended                   | 192-223 | Extended      |
|----------------------------------------------------------------|
| 192-223 | Extended                   | 224-255 | Extended      |
|----------------------------------------------------------------|

Keep in mind that ASCII is a 7-bit character encoding and has limited support for characters from languages other than English. For broader language support, other character encodings like UTF-8 (Unicode Transformation Format) are commonly used, as they can represent a much wider range of characters from various languages and scripts. UTF-8 is backward-compatible with ASCII, making it a popular choice for modern text encoding.

Here's the full ASCII table, including control characters, basic Latin characters, and extended ASCII characters:

ASCII Table
DecCharDecCharDecCharDecChar
0 NUL32( )64@ 96 `
1 SOH33! 65A 97 a
2 STX34" 66B 98 b
3 ETX35# 67C 99 c
4 EOT36$ 68D100 d
5 ENQ37% 69E101 e
6 ACK38& 70F102 f
7 BEL39' 71G103 g
8 BS 40( 72H104 h
9 TAB41) 73I105 i
10LF 42* 74J106 j
11VT 43+ 75K107 k
12FF 44, 76L108 l
13CR 45- 77M109 m
14SO 46. 78N110 n
15SI 47/ 79O111 o
16DLE480 80P112 p
17DC1491 81Q113 q
18DC2502 82R114 r
19DC3513 83S115 s
20DC4524 84T116 t
21NAK535 85U117 u
22SYN546 86V118 v
23ETB557 87W119 w
24CAN568 88X120 x
25EM 579 89Y121 y
26SUB58: 90Z122 z
27ESC59; 91[123 {
28FS 60< 92\124 |
29GS 61= 93]125 }
30RS 62> 94^126 ~
31US 63? 95_127DEL

In this table, "Dec" represents the decimal value of the character, and "Char" represents the character itself. Control characters are non-printable and are used for various control and formatting purposes, while the printable characters include letters, digits, punctuation, and symbols. The extended ASCII characters (128-255) can vary depending on specific implementations and locales.