List encoding names and aliases recognized by this system's iconv.
Which command is appropriate?
iconv -l lists encoding names and aliases supported by the iconv implementation.
Detailed explanation
locale -aIncorrect. locale -a lists available locales.
Incorrect. locale -a lists available locales.
iconv -lCorrect. iconv -l lists supported conversion encodings.
Correct. iconv -l lists supported conversion encodings.
locale charmapIncorrect. locale charmap shows only the active encoding.
Incorrect. locale charmap shows only the active encoding.
iconv -aIncorrect. -a is not the standard iconv listing option.
Incorrect. -a is not the standard iconv listing option.
Try it yourself
An example you can run in a temporary verification environment.
iconv -l | sed -n '1,10p'Expected result
環境が対応する符号化名の一覧Key points
- -l lists encodings
- Different from locale names
- Aliases vary by implementation
Notes
- Environment: iconv / 読み取りのみ
- 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.