Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Character Encoding

In short, character encoding is the mapping between a character and a numerical value that can be stored in memory. Long ago, computers in North America used 7 bits to encode all characters, which provided a usable character-set of 128 different values. Since most computers dealt with 8 bits as a byte, these 7 bits were later extended to 8 bits, or 256 possible combinations. This ASCII standard was used for decades -- at least in North America.

As applications and operating systems were built to support more languages, it became clear that better encoding systems were needed. The UTF-8 and UTF-16 systems have become widely used as ways to encode characters from different languages.

You should be comfortable referencing the ASCII and UTF-8 tables to go between characters and values, either in decimal or hexadecimal form. UTF-16 is used in Java and in Windows programming, so it is possible to see that as well.

Bookmark ASCII and UTF-8 tables on your CTF workstation of choice.

Or try the following in one line Python script:

python -c "for i in range(32, 127): print('|', i, '|', hex(i), '|', chr(i), '|')"

ASCII / UTF-8 (American English) encoding:

DecHexChar
320x20Spc
330x21!
340x22"
350x23#
360x24$
370x25%
380x26&
390x27'
400x28(
410x29)
420x2a*
430x2b+
440x2c,
450x2d-
460x2e.
470x2f/
480x300
490x311
500x322
510x333
520x344
530x355
540x366
550x377
560x388
570x399
580x3a:
590x3b;
600x3c<
610x3d=
620x3e>
630x3f?
640x40@
650x41A
660x42B
670x43C
680x44D
690x45E
700x46F
710x47G
720x48H
730x49I
740x4aJ
750x4bK
760x4cL
770x4dM
780x4eN
790x4fO
800x50P
810x51Q
820x52R
830x53S
840x54T
850x55U
860x56V
870x57W
880x58X
890x59Y
900x5aZ
910x5b[
920x5c\
930x5d]
940x5e^
950x5f_
960x60`
970x61a
980x62b
990x63c
1000x64d
1010x65e
1020x66f
1030x67g
1040x68h
1050x69i
1060x6aj
1070x6bk
1080x6cl
1090x6dm
1100x6en
1110x6fo
1120x70p
1130x71q
1140x72r
1150x73s
1160x74t
1170x75u
1180x76v
1190x77w
1200x78x
1210x79y
1220x7az
1230x7b{
1240x7c
1250x7d}
1260x7e~