Stage 3 · Lesson 2 of 9
Text encodings: ASCII, Unicode and UTF-8
Text is stored as numbers too. maps 128 characters to numbers, one byte each; for example, A is 65. Unicode gives every character in every writing system its own number, called a code point.
UTF-8 is the encoding, the storage format, that saves those code points in 1 to 4 bytes while leaving plain ASCII unchanged. UTF-8 is the default on the web and in most files you will read. Bugs appear when a program reads bytes with the wrong encoding, which produces garbled text like "café".
They also appear when code assumes one character is one byte: "é" takes 2 bytes in UTF-8 and most emoji take 4. Always name the encoding when you open a file.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CourseFreeCS50: Introduction to Computer Science
Harvard University · Beginner
Weeks 0, 1, 2 and 4 teach C, arrays and memory; the difficulty is the point
- VideoFreeCrash Course Computer Science
CrashCourse · Beginner
Short free videos from logic gates to operating systems; episodes 1 to 20
Keep handy
Also worth your time
- What Happens WhenGo deeper
Everything from a key press to a rendered page; read it after this stage