🔤 Data & Logic

Encoding: ASCII, ISCII & Unicode

एन्कोडिंग: ASCII, ISCII और Unicode

⏱ 2 hr2 topicsInteractive
🎯 By the end: You can explain how characters are stored as numbers, state key ASCII values, and describe why Unicode was needed for the world's languages.

In the Number Systems chapter you saw that computers only store numbers. So how do they store the letter 'A', or a smiley, or Hindi text? The answer is encoding: every character is assigned a unique number, and that number is what's actually stored in binary. Different schemes do this for different sets of characters.

1ASCII — encoding English

ASCII (American Standard Code for Information Interchange) gives every English character a number from 0 to 127. Because 127 fits in 7 bits, classic ASCII is a 7-bit code with 128 possible characters — enough for the English letters, digits, punctuation and some control codes.

A few ASCII values are worth memorising, because the exam loves them and the letters run in sequence:

Character(s)ASCII value
'A' to 'Z'65 to 90
'a' to 'z'97 to 122
'0' to '9'48 to 57
Space32
Handy fact: lowercase letters are exactly 32 more than their uppercase versions ('A' = 65, 'a' = 97). That 32 gap is how programs switch between upper and lower case. Also note the digit '0' is 48, not 0 — the character '0' is different from the number 0.
Key points
  • ASCII gives each English character a number 0–127, stored in 7 bits (128 characters).
  • Key values: A–Z = 65–90, a–z = 97–122, 0–9 = 48–57, space = 32.
  • Lowercase is 32 more than uppercase; the character '0' (48) differs from the number 0.

2ISCII and Unicode — encoding every language

128 characters is fine for English, but the world has thousands of characters — Devanagari, Tamil, Chinese, emoji. Two schemes extended things:

  • ISCII (Indian Script Code for Information Interchange) — an 8-bit code designed to represent Indian scripts (Devanagari, Bengali, Tamil and more) alongside ASCII. A made-in-India standard.
  • Unicode — the global solution. It aims to give every character in every language a single unique number (called a code point), so text works the same everywhere. It includes ASCII as its first 128 characters, so ASCII text is automatically valid Unicode.

UTF-8, UTF-16, UTF-32

Unicode defines the numbers; UTF (Unicode Transformation Format) defines how those numbers are stored in bytes:

SchemeUses
UTF-81 to 4 bytes per character — compact, the most common on the web (backward-compatible with ASCII).
UTF-162 or 4 bytes per character.
UTF-32A fixed 4 bytes per character — simple but uses the most space.
Because Unicode covers Indian languages and far more, it has largely become the universal standard. When you type Hindi on a phone, Unicode (usually UTF-8) is what stores it.
Key points
  • ISCII is an 8-bit Indian standard for representing Indian scripts.
  • Unicode gives a unique code point to every character of every language; its first 128 match ASCII.
  • UTF-8 (1–4 bytes, web standard), UTF-16 (2 or 4 bytes), UTF-32 (fixed 4 bytes) define how code points are stored.

★ Practical: encode by hand

Using the ASCII values from this chapter:

  1. Write the ASCII values for the characters in the word 'Cat'.
  2. If 'A' is 65, what is the ASCII value of 'a'? Explain the rule you used.
  3. What is the ASCII value of the character '5' (the digit)? How is it different from the number 5?
  4. In one sentence, explain why Unicode was needed when ASCII already existed.

Ready for the chapter test?

Answer 5 questions. Score 60% or more to mark this chapter complete.

Start the test →

💡 Log in to save your progress and earn the certificate.