Character Encoding Mastery Quiz Quiz

  1. ASCII Code Basics

    What is the decimal ASCII code for the uppercase letter 'A'?

    1. 65
    2. 97
    3. 66
    4. 64
    5. 60
  2. Unicode Standard

    Which encoding standard is designed to support every character from every language in the world?

    1. Unicode
    2. ASCII
    3. ISO8859-1
    4. UTF-7
    5. Ebcdic
  3. UTF-8 Representation

    If you encode the Unicode character 'é' (U+00E9) in UTF-8, how many bytes does it take?

    1. 2
    2. 1
    3. 4
    4. 0
    5. 3
  4. Character Set vs. Encoding

    Which of the following best describes the difference between a character set and an encoding?

    1. A character set defines the characters, encoding specifies their binary representation
    2. A character set is the same as an encoding
    3. Encoding defines characters, character set defines numbers
    4. Character sets are used only for non-text files
    5. Encoding is only used for ASCII files
  5. Identifying Corrupted Text

    You open a text file and see strange characters like 'é' where you expected 'é'. What is the most likely problem?

    1. The file was saved in UTF-8 but opened as ISO-8859-1
    2. The file is missing a newline
    3. Too many spaces were added
    4. The file uses ASCII encoding
    5. The file is password protected
  6. Octet and Byte Confusion

    Which statement is true regarding the number of bytes needed to encode the letter 'Ω' (Greek capital omega) in UTF-8?

    1. It requires 2 bytes in UTF-8
    2. It requires 1 byte in UTF-8
    3. It requires 4 bytes in UTF-8
    4. It requires 8 bytes in UTF-8
    5. It requires 3 bytes in UTF-8
  7. Encoding a String in Python

    Which Python code correctly encodes the string 'Café' into UTF-8 bytes?

    1. 'Café'.encode('utf-8')
    2. 'Café'.decode('utf-8')
    3. encode('Café', 'utf-8')
    4. 'Café'.to_bytes('utf-8')
    5. 'Café'.encrypt('utf-8')
  8. BOM and UTF-16

    What does the Byte Order Mark (BOM) indicate in UTF-16 encoding?

    1. The endianness (byte order) of the encoded text
    2. The length of the file
    3. The font to use
    4. The language of the text
    5. The encryption method
  9. Character Encoding in Web Pages

    Which HTML tag and attribute declares that a webpage uses UTF-8 encoding?

    1. u003Cmeta charset='utf-8'u003E
    2. u003Cencoding='utf-8'u003E
    3. u003Cscript charset='utf-8'u003E
    4. u003Cbody encoding='utf-8'u003E
    5. u003Chtml utf-8='true'u003E
  10. Lossless and Lossy Encodings

    Which of the following statements about ASCII and Unicode encodings is true?

    1. Both ASCII and Unicode are lossless encodings
    2. ASCII is lossy, Unicode is lossless
    3. Unicode always takes more space than ASCII for any text
    4. ASCII and Unicode cannot represent the same characters
    5. Unicode encoding requires 8 bytes per character