LFCS · Question #492
Which of the following commands can be used to convert text files in one character encoding to another character encoding?
The correct answer is D. iconv. The question asks for the command-line utility used to convert text files between different character encodings. The iconv command is specifically designed for this purpose.
Question
Options
- Acat
- Bconvert
- Cdd
- Diconv
- Eutf2utf
How the community answered
(61 responses)- A3% (2)
- B8% (5)
- C2% (1)
- D85% (52)
- E2% (1)
Why each option
The question asks for the command-line utility used to convert text files between different character encodings. The `iconv` command is specifically designed for this purpose.
`cat` is used to concatenate and display file contents, not convert character encodings.
`convert` is typically part of ImageMagick and is used for image format conversions, not text encoding.
`dd` is used for converting and copying files at a low level (e.g., block by block), but it's not designed for character encoding conversions.
The `iconv` command is a standard utility on Unix-like systems specifically designed to convert the character encoding of a file from one encoding scheme to another, such as converting a UTF-8 file to ISO-8859-1. It takes input and output encodings as arguments to perform the conversion.
`utf2utf` is not a standard Linux command for character encoding conversion.
Concept tested: Text file character encoding conversion
Source: https://linux.die.net/man/1/iconv
Topics
Community Discussion
No community discussion yet for this question.