ASCII, Unicode and UTF-8
7-bit ASCII, Latin-1, Unicode and its code points, UTF-8 from 1 to 4 bytes, UTF-16 and UTF-32 for comparison, the byte order mark and wrongly decoded text.
- 28 cards
- 7 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- On the timeline
- The numbers
- Scenarios
- Understand
A few cards from the deck
ASCII: what is it?
Show the answer
A 7-bit code, so 128 characters numbered from 0 to 127: unaccented letters, digits, punctuation and control characters.
Codes 0 to 31 and 127 are control characters (the line feed is 10); 32 is the space. No accent is in it, hence extensions such as Latin-1.
How many bytes does UTF-8 use for the € character, code point U+20AC?
- 3
- 2
- 4
- 1
Show the answer
3
U+20AC is above U+07FF and below U+FFFF: it needs the three-byte template, 1110xxxx 10xxxxxx 10xxxxxx, that is E2 82 AC.
… (ISO 8859-1) codes each character on one byte and adds Western European accented letters to ASCII, but it does not contain the € sign.
Show the answer
Latin-1 (ISO 8859-1) codes each character on one byte and adds Western European accented letters to ASCII, but it does not contain the € sign.
256 codes only suffice for one linguistic area. Its first 128 codes are ASCII's, and “é” is E9 there, a single byte, whereas it takes two in UTF-8.
Unicode: what is it?
Show the answer
The standard that gives a unique number to each character of every writing system, without saying how that number is written as bytes.
Unicode is a catalogue of numbers; UTF-8, UTF-16 and UTF-32 are three ways of encoding them as bytes. Mixing the two up is the most common mistake.