Lucas Vieites .com Logo
Lucas Vieites .com
«I intend all my puns»

Convert the charset of a file from Latin1 to UTF-8 and from UTF-8 to Latin1

 

From Latin1 (ISO 8859-1) to Unicode UTF-8:

iconv -f latin1 -t utf8 source_file.txt > target_file.txt

And vice-versa; FROM UTF-8 to Latin1:

iconv -f utf8 -t latin1 source_file.txt > target_file.txt

Note: iconv has the -c option that will omit invalid characters in the output (see the iconv man page for more information).

Author:   ✦  Published:   ✦  Updated:   ✦