Review UTF-8 compatibility with ASCII and its bytes-per-character behavior.
Which description is correct?
UTF-8 is an ASCII-compatible variable-length Unicode encoding. Characters outside ASCII can use multiple bytes.
Detailed explanation
Incorrect. UTF-8 uses multiple bytes for many characters.
Incorrect. UTF-8 uses multiple bytes for many characters.
Incorrect. ASCII characters retain their original one-byte values.
Incorrect. ASCII characters retain their original one-byte values.
Correct. UTF-8 preserves ASCII values and uses multiple bytes for other code points.
Correct. UTF-8 preserves ASCII values and uses multiple bytes for other code points.
Incorrect. UTF-8 encodes Unicode worldwide, not only Japanese.
Incorrect. UTF-8 encodes Unicode worldwide, not only Japanese.
Try it yourself
An example you can run in a temporary verification environment.
printf 'Aあ' | od -An -tx1Expected result
41 e3 81 82(UTF-8環境)Key points
- ASCII compatible
- Variable length
- Encodes Unicode
Notes
- Environment: UTF-8端末 / POSIX printfとod
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.