Linux: Convert File Encoding with iconv

By Xah Lee. Date: . Last updated: .

The GNU command line tool iconv does character encoding conversion.

iconv -f from -t to fileName1 > fileName2
Convert fileName1 from from to to and write to fileName2. Example:
iconv -f utf-16 -t utf-8 file1.txt > file2.txt
iconv -l
Show a list of encodings.

Here's the most commonly used encodings:

Convert File Encoding

Linux, Process Text