MySQL5 : Récupération de données UTF-8 stockées en ISO

15-05-2013
Laurent Bientz

Si comme nous, il vous est arrivé de récupérer un dump MySQL de données UTF-8 stockées dans un storage latin et que vous voyez de beaux caractères é, è, etc. voila une solution pas très optimale mais qui aura le mérite de vous sauver une bonne partie du contenu.

UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'’','‘');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'°','°');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'à','Ã ');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'á','á');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'â','â');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ã','ã');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ä','ä');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'å','Ã¥');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'æ','æ');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ç','ç');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'è','è');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'é','é');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ê','ê');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ë','ë');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ì','ì');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'í','Ã' );
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'î','î');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ï','ï');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ð','ð');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ñ','ñ');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ò','ò');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ó','ó');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ô','ô');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'õ','õ');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ö','ö');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ù','ù');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ú','ú');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'û','û');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ü','ü');
UPDATE `table_name` SET `column_name` = REPLACE(`column_name`,'ý','ý');

 

Vlora - 2013-09-01 16:32:49
Check that off the list of things I was confused about.

Expérience utilisateur

Wandi vous propose de découvrir une nouvelle approche de la navigation sur un site web...
Êtes-vous prêt ?

Démarrer l'expérience