The file notes.txt is encoded in ISO-8859-1 and you want the converted UTF-8 text printed on standard output (not written to a file). Type the complete iconv command, using the exact charset names ISO-8859-1 and UTF-8.
LPIC-1 Exam 102-500, objective 107. Administrative tasks medium
Draft — not checked yet. This question was written from the published exam objectives and cites the clause it comes from, but nobody has yet read it against that clause and signed for it.
It is kept out of search results and out of mock exams until they have. Read the source below before you take the answer as settled.
Answer
Type the answer.
Accepted answers
iconv -f ISO-8859-1 -t UTF-8 notes.txticonv -t UTF-8 -f ISO-8859-1 notes.txticonv --from-code=ISO-8859-1 --to-code=UTF-8 notes.txticonv -f ISO-8859-1 -t UTF-8 -- notes.txticonv notes.txt -f ISO-8859-1 -t UTF-8
Case sensitive — Linux is, and grading LS as ls would teach a falsehood.
Why
`iconv -f FROM -t TO [FILE]` converts between character encodings and writes to standard output unless -o names an output file. Reading and writing the same file in one command truncates it, so the usual pattern is `iconv -f ISO-8859-1 -t UTF-8 notes.txt -o notes.utf8`. `iconv -l` lists every encoding the local library supports. Appending //TRANSLIT to the target, as in UTF-8//TRANSLIT, approximates characters that have no representation instead of failing.
Where this comes from
- Cited
- LPI exam objective 107.3
- What it says
- Convert files between character encodings with iconv.
Practise this
Reading one question is not practice. The trainer will draw a set from objective 107 and space the ones you get wrong.