Definition
Character encoding is the set of rules that pairs each character with a unique number, so a computer can understand text and show it on screen. A computer can only handle electrical signals made of 0s and 1s, so it can't remember what a letter looks like. The term covers both the standard and the whole process of converting every character people write into a fixed binary code.
Why do letters need number tags?
Picture passing secret notes to a friend overseas. You agree on a code book: 1 means apple, 2 means banana. When people talk with a computer, they need the same kind of secret translation notebook.
Inside a computer, all that flows is electricity, with switches turning on and off. A computer can't understand the shape or meaning of a letter like 'A' or 'é' on its own. It can only remember and calculate with two values: current flowing (1) or not flowing (0).
So when you type text into a computer, something has to turn characters into numbers. For example, the letter 'A' is set to 65 and 'B' to 66, a number tag agreed on ahead of time. When you press 'A' on the keyboard, the computer stores the number 65 in memory.
This rule of pairing each character with a number, one to one, is called character encoding. When text is saved to a file, it becomes numbers. When it's shown on screen, those numbers are turned back into letter shapes and drawn.
Why text turns into alien gibberish
You've probably surfed the web or opened an old text file and seen the letters collapse into strange symbols and unfamiliar characters. Your computer isn't broken. The side that saved the text and the side that displays it are using different code books.
For example, say the writer saved a document using an older Korean number tag (EUC-KR). Then the program that opens it reads it using the international standard (UTF-8). Totally wrong characters pop out. Each code book uses different number combinations for Hangul, and different rules for reading them, so the result is a mess.
This mismatch is the real cause of garbled text: the encoding used to save the text and the rules used to read it back don't match. Only when both sides use the same code book does the text appear clean and as intended.
A bit more precisely: Unicode and UTF-8
In the early days of computing, one rule was enough: ASCII. It held 128 items: English letters, digits, basic symbols, and control signals like line breaks. But as computers spread around the world, each country started making its own number tags to handle Hangul, Chinese characters, Arabic, and many other scripts.
With hundreds of rules, confusion grew. Then came a big agreement: give every character in the world exactly one unique number. That's Unicode. And UTF-8 is the leading modern standard for storing and reading those Unicode numbers efficiently.
To be more precise, the only old text that UTF-8 can read as-is is ASCII, the standard with English letters and symbols. Text written in Wansung-style Hangul encoding or EUC-KR, which were widely used for older Hangul documents, will always come out garbled when opened as UTF-8. Even a new all-purpose standard can't automatically line up with the old Hangul number tags.
Common misconceptions
Unicode or UTF-8 can read every old Korean document, with no errors at all.
The only old text UTF-8 can read as-is is ASCII, which is mostly English letters and symbols. Hangul documents saved in the old Wansung-style encoding or EUC-KR come out garbled when opened as UTF-8.
Character encoding is the same thing as a font, which makes letters look pretty.
Encoding is the rule for recording characters as specific numbers. A font is the visual design that draws the character for each number on screen.
Where you meet it
Opening an old Hangul document in Notepad, seeing alien gibberish, and fixing it by switching the encoding setting to EUC-KR
Putting a UTF-8 encoding declaration at the top of a web page's code so that Korean and English text show correctly in browsers all over the world
In one sentence
Character encoding is the set of rules that gives each character a unique number so computers can handle text, and the same rules must be used for saving and reading, or the text gets garbled.