LX0-104 · 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 iconv command is the standard Linux utility for converting text files from one character encoding to another character encoding.
Question
Options
- Acat
- Bconvert
- Cdd
- Diconv
- Eutf2utf
How the community answered
(41 responses)- C2% (1)
- D95% (39)
- E2% (1)
Why each option
The iconv command is the standard Linux utility for converting text files from one character encoding to another character encoding.
cat is used to concatenate files and print their contents to standard output, without any character encoding conversion.
convert is typically part of ImageMagick and is used for image file format conversion, not text character encoding.
dd is a low-level utility for copying and converting file data, but it's not primarily designed for character encoding conversion and iconv is the specialized and more flexible tool for this purpose.
The iconv command is specifically designed for character set and encoding conversion of text files. It can convert between a wide range of encodings, such as UTF-8, ISO-8859-1, and UTF-16, making it the correct tool for this task.
utf2utf is not a standard or recognized command for character encoding conversion in Linux.
Concept tested: Character encoding conversion
Source: https://man7.org/linux/man-pages/man1/iconv.1.html
Topics
Community Discussion
No community discussion yet for this question.