我有一个包含大量损坏条目的数据库,例如:
IVAM BENEDITO GONÃALVES DE QUEIROZ
我尝试了几次编码转换无济于事。我发现其他报告字符Ã应该是Ã。但是在这种情况下,Ã应该是Ç。
有谁知道如何成功转换这个?目前我正在查找问题字符并替换为REPLACE()。
答案 0 :(得分:1)
不确定具体问题,但这些替换修复了数据:
UPDATE Brazil SET name = REPLACE( name, 'Ã','ç' ) WHERE name LIKE '%Ã%';
UPDATE Brazil SET name = REPLACE( name, 'À','A ' ) WHERE name LIKE '%À%';
UPDATE Brazil SET name = REPLACE( name, '©','ú' ) WHERE name LIKE '%©%';
UPDATE Brazil SET name = REPLACE( name, 'Á','A' ) WHERE name LIKE '%Á%';
UPDATE Brazil SET name = REPLACE( name, 'Â','A' ) WHERE name LIKE '%Â%';
UPDATE Brazil SET name = REPLACE( name, 'é','A' ) WHERE name LIKE '%é%';
UPDATE Brazil SET name = REPLACE( name, '±','é' ) WHERE name LIKE '%±%';
UPDATE Brazil SET name = REPLACE( name, 'ú','ú' ) WHERE name LIKE '%ú%';
UPDATE Brazil SET name = REPLACE( name, 'º','í' ) WHERE name LIKE '%º%';
UPDATE Brazil SET name = REPLACE( name, '³','ú' ) WHERE name LIKE '%³%';
UPDATE Brazil SET name = REPLACE( name, 'ô','é' ) WHERE name LIKE '%ô%';
UPDATE Brazil SET name = REPLACE( name, 'ö','ê' ) WHERE name LIKE '%ö%';
UPDATE Brazil SET name = REPLACE( name, 'Ç','ç' ) WHERE name LIKE '%Ç%';
UPDATE Brazil SET name = REPLACE( name, '¤','á' ) WHERE name LIKE '%¤%';
UPDATE Brazil SET name = REPLACE( name, 'Z¡','á' ) WHERE name LIKE '%Z¡%';
UPDATE Brazil SET name = REPLACE( name, '¡','ó' ) WHERE name LIKE '%¡%';
UPDATE Brazil SET name = REPLACE( name, 'ý','ç' ) WHERE name LIKE '%ý%';
UPDATE Brazil SET name = REPLACE( name, '┼','é' ) WHERE name LIKE '%┼%';
UPDATE Brazil SET name = REPLACE( name, '¾','á' ) WHERE name LIKE '%¾%';
UPDATE Brazil SET name = REPLACE( name, 'Ø','ã' ) WHERE name LIKE '%Ø%';
UPDATE Brazil SET name = REPLACE( name, 'Ø','ã' ) WHERE name LIKE '%Ø%';
UPDATE Brazil SET name = REPLACE( name, 'É','é' ) WHERE name LIKE '%É%';
UPDATE Brazil SET name = REPLACE( name, 'Ç','ç' ) WHERE name LIKE '%Ç%';
UPDATE Brazil SET name = REPLACE( name, 'â•”','é' ) WHERE name LIKE '%â•”%';
UPDATE Brazil SET name = REPLACE( name, 'Õ','ú' ) WHERE name LIKE '%Õ%';
UPDATE Brazil SET name = REPLACE( name, 'â•','í' ) WHERE name LIKE '%â•%';
UPDATE Brazil SET name = REPLACE( name, '¶','ã' ), name = REPLACE( name, 'µ','á' ), name = REPLACE( name, 'Â','' ) WHERE name LIKE '%ÂÂ%';
UPDATE Brazil SET name = REPLACE( name, 'µ','ñ' ) WHERE name LIKE '%µ%';
UPDATE Brazil SET name = REPLACE( name, 'Ãœ','ü' ) WHERE name LIKE '%Ãœ%';
UPDATE Brazil SET name = REPLACE( name, '├','ã' ) WHERE name LIKE '%├%';
UPDATE Brazil SET name = REPLACE( name, 'ë','ã' ) WHERE name LIKE '%ë%';
UPDATE Brazil SET name = REPLACE( name, 'Ô','õ' ) WHERE name LIKE '%Ô%';
UPDATE Brazil SET name = REPLACE( name, '¨','ã' ) WHERE name LIKE '%¨%';
UPDATE Brazil SET name = REPLACE( name, 'ÃŒ','â' ) WHERE name LIKE '%ÃŒ%';
UPDATE Brazil SET name = REPLACE( name, '°','é' ) WHERE name LIKE '%°%';
UPDATE Brazil SET name = REPLACE( name, 'æ','í' ) WHERE name LIKE '%æ%';
UPDATE Brazil SET name = REPLACE( name, 'Â¥','ú' ) WHERE name LIKE '%Â¥%';
UPDATE Brazil SET name = REPLACE( name, '¿','ó' ) WHERE name LIKE '%¿%';
UPDATE Brazil SET name = REPLACE( name, '×','ç' ) WHERE name LIKE '%×%';
UPDATE Brazil SET name = REPLACE( name, '┬Â','ã' ) WHERE name LIKE '%┬Â%';
UPDATE Brazil SET name = REPLACE( name, 'Â','â' ) WHERE name LIKE '%Â%';
UPDATE Brazil SET name = REPLACE( name, 'ãâ','ã' ) WHERE name LIKE '%ãâ%';
UPDATE Brazil SET name = REPLACE( name, 'Z£','ã' ) WHERE name LIKE '%Z£%';
UPDATE Brazil SET name = REPLACE( name, '£','ú' ) WHERE name LIKE '%£%';
UPDATE Brazil SET name = REPLACE( name, 'Z¢','ã' ) WHERE name LIKE '%Z¢%';
UPDATE Brazil SET name = REPLACE( name, 'ã│','ó' ) WHERE name LIKE '%ã│%';
UPDATE Brazil SET name = REPLACE( name, 'ã¢','ç' ) WHERE name LIKE '%ã¢%';
UPDATE Brazil SET name = REPLACE( name, 'á┢','ç' ) WHERE name LIKE '%á┢%';
UPDATE Brazil SET name = REPLACE( name, '┬│','a ' ) WHERE name LIKE '%┬│%';
UPDATE Brazil SET name = REPLACE( name, 'ç£','í' ) WHERE name LIKE '%ç£%';
UPDATE Brazil SET name = REPLACE( name, '¶','õ' ) WHERE name LIKE '%¶%';
UPDATE Brazil SET name = REPLACE( name, '§','ú' ) WHERE name LIKE '%§%';
UPDATE Brazil SET name = REPLACE( name, '¾','ó' ) WHERE name LIKE '%¾%';
UPDATE Brazil SET name = REPLACE( name, 'Ã','ç' ) WHERE name LIKE '%Ã%';