Appendix A

ASCII Codes

9781118737637-tbunbapp0101a.png

9781118737637-tbunbapp0101b.png

9781118737637-tbunbapp0101c.png

9781118737637-tbunbapp0101d.png

check.png ASCII 0 through ASCII 31 represent control code values. These characters are accessed by pressing the Ctrl key on the keyboard and typing the corresponding symbol or letter key.

check.png Code 32 is the code for the space character.

check.png Code 127 is the Delete character, which is different from Code 8, often called Backspace. That’s because Code 8 is defined as nondestructive, which means that it only moves the cursor back a space.

check.png Many of the control codes manipulate text on the screen, such as Ctrl+I for the Tab key.

check.png A keen eye spots three repetitions in the ASCII code lists. Look at codes 0 through 26 and then 64 through 90. Also look at codes 97 through 122.

check.png The difference between uppercase and lowercase characters in the table is 32, a computer holy number. The hexadecimal difference is 0x20. Therefore, by using simple math, or bitwise logic, you can convert between upper- and lowercase.

check.png The digits 0 through 9 are equal to the values 0 through 9 when you subtract 48 (0x30) from the ASCII code values. Likewise, to convert values 0 through 9 into their corresponding ASCII characters, add 48 or 0x30.

check.png Any ASCII character can be represented as an escape sequence. Follow the backslash with the character's code value, as in \33 for the exclamation point (!) character. The hexadecimal value can also be used, as in \x68 for the little H.