Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

SC 3.5: ASCII, UTF-8 and choosing a format

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

The name with square boxes

A help desk imports a list of users. Most names look fine. One shows as "José" with a broken mark, and another is only boxes.

The file used one way to turn letters into numbers. The program reading it used another. This lesson explains the two main ways.

By the end of this lesson

Note

I can say how letters become numbers, and choose a file layout that suits a job.

Key words

WordWhat it meansExample
CSVOne record per line, fields split by commas.12,A4
JSONLabelled pairs inside braces, sent between programs.{"id": 12}
XMLText in nested tags that name each piece.<id>12</id>
Character setA list that gives every character a number.ASCII
ASCIIA small character set of 128 codes for English letters, digits and symbols.A is 65
UTF-8A character set that covers every language and emoji.The letter e with an accent
ByteA small unit of stored data, 8 bits.One ASCII character
EncodingThe rule that turns characters into bytes and back.UTF-8
CompatibleAble to work with something else without a change.ASCII text is valid UTF-8.

The cells students fill in are left blank in this preview.

Starter: what you already know

Have a go

Starter: what you already know

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

ASCII: 128 characters

A computer stores numbers, so every character needs a number. A character set is the list that says which.

ASCII has 128 codes. It holds English capital and small letters, the digits, punctuation and some control codes. A capital A is 65. A small a is 97. It has no accents and no other alphabets.

UTF-8: every language

UTF-8 can hold characters from every language, and emoji. It uses one byte for the first 128 characters and more bytes for the rest.

The first 128 codes are the same as ASCII, so ASCII text is compatible with UTF-8. Most of the web uses UTF-8 today.

ASCII and UTF-8 side by side

QuestionASCIIUTF-8
How many characters?128Over a million possible
Accents and other alphabets?NoYes
Emoji?NoYes
Bytes per characterOneOne to four
Same codes for A to Z?YesYes

The cells students fill in are left blank in this preview.

Check: ASCII or UTF-8?

Have a go

Check: ASCII or UTF-8?

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

6 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.