Exercises
Explore how programs represent and process text using Unicode and UTF-8. This quiz covers code points, encoding and decoding, variable-length byte sequences, normalization, replacement characters, and grapheme clusters. It is designed to help beginning programmers avoid common mistakes involving string length, indexing, storage, and international text.
Answer the questions below and check the explanation for each answer.
0/10 answered
Auto audio on: the next questions will be read aloud when you click Continue.
A character encoding defines how textual characters or code points are represented as bytes for storage or transmission.
Unicode code points are conventionally written as U+ followed by hexadecimal digits. Uppercase A is U+0041.
Every UTF-8 continuation byte begins with 10. Prefixes such as 110, 1110, and 11110 identify leading bytes of multibyte sequences.
The binary value 01000001 equals hexadecimal 41, which represents uppercase A in both ASCII and UTF-8.
The precomposed character é is U+00E9 and is encoded as two bytes in UTF-8 because its code point is above the one-byte ASCII range.
The string has four code points. The ASCII characters c, a, and f use one byte each, while é uses two UTF-8 bytes, producing five bytes total.
The replacement character is commonly inserted when a decoder encounters invalid input or cannot map a byte sequence to a valid character.
U+00E9 and the sequence U+0065 U+0301 are canonically equivalent. Unicode normalization can convert between composed and decomposed forms.
UTF-8 is variable-length. A character may occupy one to four bytes, so an arbitrary byte offset can point to a continuation byte rather than a character boundary.
A user-perceived character is called a grapheme cluster. Some emoji are rendered as one symbol even though they contain several code points joined into a sequence.
Video Courses
Ideal for beginners
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks