Linux: Convert File Encoding with iconv
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:
- ASCII
- UTF8
- UTF-16
- UTF-16BE
- UTF-16LE
- GB18030
- JIS_X0208