ASCII Code Basics
What is the decimal ASCII code for the uppercase letter 'A'?
- 65
- 97
- 66
- 64
- 60
Unicode Standard
Which encoding standard is designed to support every character from every language in the world?
- Unicode
- ASCII
- ISO8859-1
- UTF-7
- Ebcdic
UTF-8 Representation
If you encode the Unicode character 'é' (U+00E9) in UTF-8, how many bytes does it take?
- 2
- 1
- 4
- 0
- 3
Character Set vs. Encoding
Which of the following best describes the difference between a character set and an encoding?
- A character set defines the characters, encoding specifies their binary representation
- A character set is the same as an encoding
- Encoding defines characters, character set defines numbers
- Character sets are used only for non-text files
- Encoding is only used for ASCII files
Identifying Corrupted Text
You open a text file and see strange characters like 'é' where you expected 'é'. What is the most likely problem?
- The file was saved in UTF-8 but opened as ISO-8859-1
- The file is missing a newline
- Too many spaces were added
- The file uses ASCII encoding
- The file is password protected
Octet and Byte Confusion
Which statement is true regarding the number of bytes needed to encode the letter 'Ω' (Greek capital omega) in UTF-8?
- It requires 2 bytes in UTF-8
- It requires 1 byte in UTF-8
- It requires 4 bytes in UTF-8
- It requires 8 bytes in UTF-8
- It requires 3 bytes in UTF-8
Encoding a String in Python
Which Python code correctly encodes the string 'Café' into UTF-8 bytes?
- 'Café'.encode('utf-8')
- 'Café'.decode('utf-8')
- encode('Café', 'utf-8')
- 'Café'.to_bytes('utf-8')
- 'Café'.encrypt('utf-8')
BOM and UTF-16
What does the Byte Order Mark (BOM) indicate in UTF-16 encoding?
- The endianness (byte order) of the encoded text
- The length of the file
- The font to use
- The language of the text
- The encryption method
Character Encoding in Web Pages
Which HTML tag and attribute declares that a webpage uses UTF-8 encoding?
- u003Cmeta charset='utf-8'u003E
- u003Cencoding='utf-8'u003E
- u003Cscript charset='utf-8'u003E
- u003Cbody encoding='utf-8'u003E
- u003Chtml utf-8='true'u003E
Lossless and Lossy Encodings
Which of the following statements about ASCII and Unicode encodings is true?
- Both ASCII and Unicode are lossless encodings
- ASCII is lossy, Unicode is lossless
- Unicode always takes more space than ASCII for any text
- ASCII and Unicode cannot represent the same characters
- Unicode encoding requires 8 bytes per character