Unicode
Unicode is a standard that gives letters, punctuation, and other elements of text shared numeric identifiers. Encodings such as UTF-8 specify how to store those identifiers as bytes.
Also known as: UTF-8, кодировка
What Unicode standardizes
When a program reads A, it needs an identifier that means the same thing in a browser, a text editor, and a database. Unicode assigns the Latin capital letter A the code point U+0041. A code point is a number, conventionally written in hexadecimal after U+. Cyrillic capital A (А) looks much the same in many fonts, but it has a different code point, U+0410. Unicode identifies the letters; the font determines how they look.
Unicode is not UTF-8
A code point tells you which element of text you're dealing with. An encoding tells you how to represent it in a form you can store or transmit. UTF-8 uses one to four bytes per code point: A is the single byte 41 in hexadecimal, while é (U+00E9) is C3 A9. ASCII text uses exactly the same bytes in UTF-8. UTF-16 is another Unicode encoding: it uses one or two 16-bit code units per code point. A code unit is the basic unit an encoding uses to build its representation.
What does “one character” mean?
Consider a text field where the user enters e followed by a combining acute accent. The two code points appear together as one é. Unicode text segmentation treats that sequence as one grapheme cluster: roughly, one character as perceived by the reader. A storage limit and a text editor's cursor often need to count different things.
import unicodedata
text = "e\u0301" # e followed by a combining acute accent
len(text) # 2 code points in Python
len(text.encode("utf-8")) # 3 bytes in UTF-8
text == "é" # False: different code point sequences
unicodedata.normalize("NFC", text) == "é" # True
NFC normalization gives canonically equivalent sequences the same representation. It helps when an application needs both spellings of é to compare equal, but it does not merge unrelated lookalikes such as Latin A and Cyrillic А.
Where the distinction matters
At a file or network boundary, decode incoming bytes using the encoding specified by the format or sender. Reading UTF-8 with the wrong decoder can turn valid input into garbled text. On output, measure the encoded bytes if you're enforcing a byte limit; don't simply slice those bytes, because the cut could land inside a UTF-8 sequence. If you're shortening a label for display, cut at grapheme cluster boundaries so you don't leave an accent behind or split a multi-code-point emoji.
In interviews
A common question is why "😀".length returns 2 in JavaScript. The emoji is one code point, but JavaScript's length counts UTF-16 code units, and this code point takes two. In a coding exercise about reversing or truncating a string, clarify what the prompt means by “character” before choosing how to iterate.