Search code examples
mysqldatabaseencodingutf-8diacritics

latin-1 to utf-8 database


I have a database that is uft8_general_ci, only problem is up until this point an application coded by a previous developer seems to have been working with the database in latin-1.

I have since changed how the app uses the database and can now store an umlaut as an umlaut instead of ü. The problem now is that the application reads the previously existing data from the database as (example) 'Süddeutsche' instead of 'Süddeutsche'.

Is there anyway to convert the data inside the database from one format to the other?

Regards

Edit:

ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET latin1;
ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET binary;
ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET utf8;

This worked for me.


Solution

  • http://blog.hno3.org/2010/04/22/fixing-double-encoded-utf-8-data-in-mysql/

    Using what is listed here has fixed all my problems. I used this with my live data and have had no issues!