Computer Science · Ch 2 — Encoding Schemes and Number System
UNICODE
UNICODE
By the time computers had spread across the world, there were many encoding schemes, each covering the character set of a different language. The trouble was that they could not talk to each other: every scheme represented characters in its own way, so text created on a machine using one encoding was simply not recognised by a machine using another. What was needed was one scheme big enough for everything.
One number for every character, everywhere
That scheme is UNICODE — a standard developed to incorporate all the characters of every written language of the world. Its central promise:
UNICODE provides a unique number for every character, irrespective of
- the device (server, desktop, mobile),
- the operating system (Linux, Windows, iOS), or
- the software application (different browsers, text editors, and so on).
Because the number is the same everywhere, text written on one system displays identically on any other — the interoperability problem that plagued the older schemes disappears.
UNICODE encodings and its relationship with ASCII
- The commonly used UNICODE encodings are UTF-8, UTF-16 and UTF-32.
- UNICODE is a superset of ASCII: the values 0–128 represent the same characters as in ASCII. Plain English text is therefore automatically valid UNICODE.
(Recall the earlier "think and reflect" question — a character in UTF-32 occupies more space than the same character in UTF-16 or UTF-8; the three encodings trade storage size differently while representing the same code values.)
Devanagari in UNICODE
Every script gets its own block of code values, each written in hexadecimal. For the Devanagari script the characters occupy the range around 0900–097F. A few examples from the Unicode table for Devanagari (character → hexadecimal code value):
| Character | Hex value | Character | Hex value |
|---|---|---|---|
| अ | 0905 | क | 0915 |
| आ | 0906 | ख | 0916 |
| इ | 0907 | ग | 0917 |
| ई | 0908 | घ | 0918 |
| उ | 0909 | च | 091A |
| ऊ | 090A | ट | 091F |
| ए | 090F | त | 0924 |
| ऐ | 0910 | म | 092E |
| ओ | 0913 | र | 0930 |
| औ | 0914 | ह | 0939 |
| ऀ 0900 | ँ 0901 | ं 0902 | ः 0903 | ऄ 0904 | अ 0905 | आ 0906 | इ 0907 | ई 0908 | उ 0909 | ऊ 090A | ऋ 090B | ऌ 090C | ऍ 090D | ऎ 090E | ए 090F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ऐ 0910 | ऑ 0911 | ऒ 0912 | ओ 0913 | औ 0914 | क 0915 | ख 0916 | ग 0917 | घ 0918 | ङ 0919 | च 091A | छ 091B | ज 091C | झ 091D | ञ 091E | ट 091F |
| ठ 0920 | ड 0921 | ढ 0922 | ण 0923 | त 0924 | थ 0925 | द 0926 | ध 0927 | न 0928 | ऩ 0929 | प 092A | फ 092B | ब 092C | भ 092D | म 092E | य 092F |
| र 0930 | ऱ 0931 | ल 0932 | ळ 0933 | ऴ 0934 | व 0935 | श 0936 | ष 0937 | स 0938 | ह 0939 | ऺ 093A | ऻ 093B | ़ 093C | ऽ 093D | ा 093E | ि 093F |
| ी 0940 | ु 0941 | ू 0942 | ृ 0943 | ॄ 0944 | ॅ 0945 | ॆ 0946 | े 0947 | ै 0948 | ॉ 0949 | ॊ 094A | ो 094B | ौ 094C | ् 094D | ॎ 094E | ॏ 094F |
| ॐ 0950 | ॑ 0951 | ॒ 0952 | ॓ 0953 | ॔ 0954 | ॕ 0955 | ॖ 0956 | ॗ 0957 | क़ 0958 | ख़ 0959 | ग़ 095A | ज़ 095B | ड़ 095C | ढ़ 095D | फ़ 095E | य़ 095F |