0

I started working on a legacy mysql database whose collation: latin1-default but tables are utf-8-default. Even though tables are mentioned with utf-8 (universal standard encoding) it doesn't render Swedish characters. It seems application related to this database encoding is ISO-8859-1. So, I would like to convert this database and data in it to ISO-8859-1 encoding. I tried with this command

  iconv -f  UTF-8 -t ISO-8859-1   webtest_backu_01.sql > converted-file.sql

it gives error: illegal input sequence at position

any help is appreciated. thanks.

dotnetrocks
  • 2,589
  • 12
  • 36
  • 55

1 Answers1

1

Please take a look at this link: http://dev.mysql.com/doc/refman/5.0/en/charset-conversion.html

You can use the alter table command to make this conversion per-table if it is possible. I used this before successfully.

Example from the link:

ALTER TABLE t MODIFY col1 CHAR(50) CHARACTER SET utf8;

Also an important detail... Conversion may be lossy if the column contains characters that are not in both character sets... but I don't think ISO-8859-1 to UTF-8.

Give this a try for one of the tables and see if it works.

Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152