Cambridge 9618 · International A Level Computer Science · ~12 min read
Notes
Video
Slides
Quiz
Worksheet
Character Encoding
Computers store all data as binary. To represent text, every character (letters, digits, punctuation, control characters) is assigned a unique binary code. The system defining this mapping is called a character encoding or character set.
ASCII (American Standard Code for Information Interchange)
Standard ASCII uses 7 bits per character, giving 2⁷ = 128 possible characters. These include:
Control characters (0–31): non-printable, e.g. null (0), carriage return (13), newline (10)
Note that uppercase letters (A=65) and lowercase letters (a=97) differ by 32 (or bit 5). Digits start at 48, so '0'=48, '1'=49, ..., '9'=57.
Extended ASCII
Extended ASCII uses 8 bits, giving 256 characters (0–255). The extra 128 codes (128–255) were used for national characters (e.g. accented letters like é, ñ), but different countries implemented different extensions — causing compatibility problems.
Unicode
ASCII was designed for English and cannot represent characters from most of the world's languages. Unicode is a universal character standard that assigns a unique code point to every character in every language, plus emoji, symbols, and technical characters.
Property
ASCII
Unicode
Bits per character
7 (standard) / 8 (extended)
Varies (8, 16, 32 depending on encoding)
Number of characters
128 / 256
Over 1,114,112 code points
Languages supported
English only (standard)
All world languages + emoji + symbols
Backward compatible
—
Yes — first 128 Unicode code points match ASCII
Unicode Encodings
Unicode defines code points (U+0041 for 'A'), but the actual binary storage format is called an encoding:
UTF-8: Variable length (1–4 bytes). Compatible with ASCII for first 128 characters. Most common on the web.
UTF-16: Uses 2 or 4 bytes. Used internally by many operating systems (Windows, Java).
UTF-32: Fixed 4 bytes per character. Simple but uses more memory.
Advantages of Unicode over ASCII
Supports all world languages, scripts, and symbols in a single standard
Eliminates ambiguity caused by different ASCII extension tables
Backward compatible — existing ASCII documents work without changes
Supports emoji, mathematical symbols, ancient scripts
Disadvantage of Unicode
Uses more memory per character (especially UTF-16 and UTF-32) compared to ASCII
More complex to implement and process than fixed-length ASCII
Exam tip: Know the ASCII codes for 'A' (65), 'a' (97), '0' (48). Be able to state that ASCII uses 7 bits (128 characters) and Unicode supports all world languages. For Unicode questions: state that Unicode uses more bits per character, supports more characters, is backward compatible with ASCII. Cambridge often asks for advantages/disadvantages or comparisons between the two.
⚠️ Common Mistakes
Saying ASCII uses 8 bits — standard ASCII is 7 bits (extended ASCII is 8 bits)
Confusing character encoding with character set (they are related but not identical)
Forgetting that Unicode is backward compatible with ASCII
8 questions · instantly marked · Cambridge 9618 standard
Q1State the number of bits used in standard ASCII and calculate how many different characters it can represent.[2]
✅ Mark scheme
Mark scheme
7 bits [1]; 2⁷ = 128 characters [1].
Q2The ASCII code for 'A' is 65 (denary). What is the ASCII code for 'D'? Show your reasoning.[2]
✅ Mark scheme
Mark scheme
Letters are sequential: A=65, B=66, C=67, D=68 [1]; ASCII code for 'D' = 68 [1].
Q3Explain why ASCII cannot be used to represent text in Arabic, Chinese or other non-Latin scripts.[2]
✅ Mark scheme
Mark scheme
ASCII only defines 128 (or 256 in extended) characters [1]; not enough to represent the thousands of characters needed for Arabic, Chinese etc. — ASCII was designed for English/Latin script only [1].
Q4State two advantages of Unicode over ASCII.[2]
✅ Mark scheme
Mark scheme
Any two: Supports all world languages and scripts [1]; Supports over 1 million code points (far more than ASCII) [1]; Backward compatible with ASCII [1]; Eliminates ambiguity of different extended ASCII tables [1]; Supports emoji and symbols [1].
Q5State one disadvantage of Unicode compared to ASCII.[1]
✅ Mark scheme
Mark scheme
Any one: Uses more storage/memory per character [1]; More complex to process [1]; Variable-length encoding (UTF-8) can complicate string manipulation [1].
Q6Explain what is meant by 'backward compatible' in the context of Unicode and ASCII.[2]
✅ Mark scheme
Mark scheme
The first 128 Unicode code points are identical to the ASCII character set [1]; files and software using ASCII encoding can be interpreted correctly without modification when Unicode is used [1].
Q7UTF-8 is described as a variable-length encoding. What does this mean, and why is it useful?[3]
✅ Mark scheme
Mark scheme
Variable length means different characters use different numbers of bytes (1–4 bytes) [1]; common characters (ASCII range) use only 1 byte [1]; this makes storage efficient — documents using mainly Latin script are no larger than equivalent ASCII files [1].
Q8A student claims that ASCII is always preferable to Unicode because it uses less memory. Evaluate this claim.[3]
✅ Mark scheme
Mark scheme
Partially correct — ASCII uses only 7/8 bits per character vs UTF-16/UTF-32 which use more [1]; however, UTF-8 uses just 1 byte for ASCII-range characters, matching ASCII storage use [1]; ASCII cannot represent non-Latin scripts at all, making it unsuitable for global use — Unicode is necessary for any multilingual application [1].
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 10
Click to reveal definition
🎉
All cards reviewed!
Term
Definition
🎯
Mini Test — 1.1.4 Character Encoding
10 questions · 10 marks · 10 minutes
⏱ 10:00
10 marks
Section A — Multiple Choice [5 marks]
Q1How many bits does standard ASCII use per character?
Q2The ASCII code for 'A' is 65. What is the ASCII code for 'a'?
Q3Which of the following is a correct statement about Unicode?
Q4Why was Unicode developed to replace ASCII as the dominant standard?
Q5UTF-8 is described as variable-length. What does this mean?
Section B — Short Answer [5 marks]
Q6State the ASCII code for the digit character '0'.
Mark scheme48 [1 mark].
Q7State one difference between standard ASCII and extended ASCII.
Mark schemeStandard ASCII uses 7 bits (128 characters); extended ASCII uses 8 bits (256 characters) [1 mark]. Accept: extended ASCII includes additional characters such as accented letters.
Q8Give one advantage and one disadvantage of using Unicode instead of ASCII.
Mark schemeAdvantage: supports all world languages / more characters [1]; Disadvantage: uses more memory / more bits per character [1].
Q9Explain what is meant by 'character encoding'.
Mark schemeA system/standard that assigns a unique binary (numeric) code to each character [1 mark]. Accept: a mapping between characters and binary numbers.
Q10How many characters can standard ASCII represent? Show your calculation.