Mysql – Recover Wrong encoded string values in MySQL database

encodingMySQLPHP

I have a database in which I store the alt and title values of the images. Unfortunately the program which inserts these values hasn't been connecting to the MySQL database with a UTF-8 link and the data it has inserted to the database is not in Unicode. I have fixed that but I was wondering if there is some way to retrieve the original values from the database and convert them to Unicod

Best Answer

A possible solution:

  1. Dump your table data with mysqldump or any other favorite tool
  2. Fix encoding in dump file using one of the utilities (there are plenty out there)
  3. Load data back