The name with square boxes
An analyst imports a survey file. 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.
Key words
| Word | What it means | Example |
|---|---|---|
| CSV | One record per line, fields split by commas. | 12,A4 |
| JSON | Labelled pairs inside braces, sent between programs. | {"id": 12} |
| XML | Text in nested tags that name each piece. | <id>12</id> |
| Character set | A list that gives every character a number. | ASCII |
| ASCII | A small character set of 128 codes for English letters, digits and symbols. | A is 65 |
| UTF-8 | A way of storing Unicode, the character set that covers every language and emoji. | The letter e with an accent |
| Byte | A small unit of stored data, 8 bits. | One ASCII character |
| Encoding | The rule that turns characters into bytes and back. | UTF-8 |
| Compatible | Able 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.
By the end of this lesson
Note
I can say how letters become numbers, and choose a file layout that suits a job.
Starter: what you already know
Have a go
Starter: what you already know
3 questionsYour 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
| Question | ASCII | UTF-8 |
|---|---|---|
| How many characters? | 128 | Over a million possible |
| Accents and other alphabets? | No | Yes |
| Emoji? | No | Yes |
| Bytes per character | One | One to four |
| Same codes for A to Z? | Yes | Yes |
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 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.