Beginner Topic 5 of 51 Computer Architecture & Logic
Character Encoding
Mapping characters to numeric codes such as ASCII and Unicode.
How it works
A character encoding maps characters to numbers and then to bytes. ASCII uses 7 bits for English letters, digits and punctuation. Unicode assigns a code point to every character in every writing system, and UTF-8, UTF-16 and UTF-32 are ways to serialize them. UTF-8 is variable length, from one to four bytes, and is backward compatible with ASCII, making it dominant on the web.
Where it is used
Reading and writing text files, web pages and HTTP headers, databases, internationalized software and emoji support all depend on encoding. Declaring the charset correctly lets browsers and programs interpret bytes.
Common pitfall
Decoding bytes with the wrong encoding produces garbled text known as mojibake. String length in bytes differs from length in characters, and one visible character can be several code points. Always specify UTF-8 explicitly, normalize text before comparing and never cut a multi-byte sequence in the middle.
Where it fits in the course
Character Encoding is topic 5 of 51 in Computer Architecture & Logic, rated Beginner. It follows Floating Point Representation. The next topic is Logic Gates.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Computer Architecture & Logic quiz.
- Explore the Binary & Two's Complement visualizer: Flip bits and watch the number change.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Computer Architecture & Logic quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Character Encoding?
Where do people use Character Encoding?
What is the most common mistake with Character Encoding?
What should I learn before this topic?
How can I practice it?
Is Character Encoding hard to learn?
How long does it take to learn Character Encoding?
Which topics are related to Character Encoding?
What should I study after Character Encoding?
Related topics
- Floating Point Representation (Computer Architecture & Logic)
- Logic Gates (Computer Architecture & Logic)
- Two's Complement (Computer Architecture & Logic)
- Truth Tables (Computer Architecture & Logic)