Character Sets
Every character you type is stored as a binary code, and that code is used later to display the character. When you press a key, the computer does not store a picture of the letter or symbol. Instead, it finds the code for that character in the character set it is using and stores that code in memory. For example, pressing the key marked G stores the code for G, not the shape of a G.
When the computer needs to display text, it reads each stored code in turn. It looks up the code in the character set to find which character it represents, then outputs that character. Only then is the current font used to draw the character's shape on screen, so the same stored code can look quite different in a different font. The stored code is what connects the key you pressed to the character you see.
Each character in a word or string has its own separate code. If you type the label Year 9, the computer stores six separate codes: one for each letter, one for the space and one for the digit. They are kept in order so the label can be rebuilt. The codes are not squashed into one number. Doing that would lose where each character begins and ends, so the label could not be read back correctly.
| Action | Result |
|---|---|
| Store each character's code separately, in order | The label Year 9 displays correctly, including the space |
| Store the codes as one combined number | The computer cannot tell where each character starts, so the label cannot be rebuilt correctly |
OCR GCSE Computer Science · Character Sets