Tag replace

Replacing characters in MySQL table data

This may be useful when for example the character encoding has been messed up and you need to correct existing data. This example will correct swedish accented characters in a uft8 – latin1 mixup. UPDATE my_table SET my_field = REPLACE(my_field,’Ã¥’,'å’);   UPDATE my_table SET my_field = REPLACE(my_field,’ä’,'ä’);   UPDATE my_table SET my_field = REPLACE(my_field,’ö’,'ö’);  …