I have mysql tables with utf8 encoding. The Data Backend and phpmyadmin are also set to utf8.
But something went wrong and i was told the connection was set wrong. It is easy to fix, but the Problem is, that now the whole Database is in the wrong enconding and if i fix the connection, the wrong data will be displayed in the Backend. What would be the simplest way to "convert" all fields of all tables? I would have written a script that runs over all tables and fields with something like utf8_decode/encode, but I would like to know if there is a nicer way?
If you have, for example,
é
instead ofé
in your DB, you could do the followingmysqldump
utf8_encode(file_get_contents('dump_file.sql'))
and output it to a correctly encoded dump filemysql
I guess that there could be smarter ways but I hope this will help.