Using Linux/UNIX shell to convert encoding of SQL database files or any text files

 

del.icio.us Tags: ,,,,

 

iconv, provided by sys-libs/glibc, is used to convert text files from one charset to another. iconv can be used to recode a sql dump even if the environment is not set to utf8.

From latin1 to utf8
$ iconv -f ISO-8859-15 -t UTF-8 file1.sql > file2.sql

From Japanese to utf8

$ iconv -f ISO2022JP -t UTF-8 file1.sql > file2.sql

Comments

Post new comment