I have latin1 encoded data sitting in a UTF-8 mysql database, how do I fix this? There is no original data to go from unfortunately.
I figured out this much as the only way I could display the data correctly was to set everything latin1 in PHP, HTML and MySQL.
Once this is completed, I can change everything back to utf-8 in my html and php.
Versions:
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2
EDIT:
I should mention, everything is working OK as I am telling PHP and HTML to use latin1 encoding, however, this just seems bad to me.
I believe that this article does exactly what you need to.
I’ve paraphrased the steps you need to take below – replace ‘MyDb’ with the name of your database. I would recommend making a backup before you begin!
Copy the output of all the
SELECTstatements above into a SQL script. Add the following to it:Switch to MyDb (
USE MyDb;) and run the SQL script.