Question 1A register must store names containing A, an accented e (U+00E9), and a smiling face U+1F642. Assume UTF-8 uses 1, 2 and 4 bytes respectively for these characters. (a) Compare 7-bit ASCII, an 8-bit extended-ASCII code page and Unicode for this register, including the danger of exchanging unspecified code pages. (b) Find the UTF-8 payload for 10 copies of the three-character sequence. (c) Explain why Unicode is not synonymous with 16 bits per character.4 indicative marks
A register must store names containing A, an accented e (U+00E9), and a smiling face U+1F642. Assume UTF-8 uses 1, 2 and 4 bytes respectively for these characters. (a) Compare 7-bit ASCII, an 8-bit extended-ASCII code page and Unicode for this register, including the danger of exchanging unspecified code pages. (b) Find the UTF-8 payload for 10 copies of the three-character sequence. (c) Explain why Unicode is not synonymous with 16 bits per character.
Cambridge 2027: Direct conceptual match
Character sets and encoded byte lengths: each cited registered row is explicitly requested and demonstrated in the worked answer. UTF-8 byte count independently checked with a real encoder: three code points occupy seven bytes, repeated ten times seventy. Written conceptual evidence only, pending independent teacher review; not execution by the learner or practical certification.
- 9618: 1.1 Data Representation / Candidates should be able to / objective row 5: Character encoding with ASCII, extended ASCII and Unicode
AI-assisted placement. Independent teacher approval pending.
Show indicative guidance
Worked guidance
- 7-bit ASCII represents 2^7=128 characters, including A but not the accented letter or the smiling face. An 8-bit extension has 256 codes, but code pages disagree about many values above 127; a byte can become a different character if decoded with the wrong page.
- Unicode provides a common code-point repertoire. Select an agreed encoding such as UTF-8 at both ends, rather than treating every character as an ASCII byte. For the supplied sequence the payload is 1+2+4=7 bytes, so 10 copies occupy 70 bytes, excluding metadata.
- A code point is an abstract character number, not necessarily a single 16-bit storage unit. UTF-8 uses varying byte lengths; UTF-16 can require two 16-bit units for a supplementary code point such as U+1F642. Character count alone does not determine encoded file size.
Self-marking points
View marking points
- ASCII has 128 codes and cannot represent all required characters.
- Extended ASCII has 256 codes per code page, not one universal mapping.
- Unicode assigns code points; UTF encodings determine bytes and can represent the whole name.
- Obtain 70 bytes and distinguish code points from code units.
Examiner tip
Give intermediate states and explicit assumptions. These are indicative distinct points, not an official mark allocation or evidence that you completed a practical assessment.