dp.cx blog

Posted on

Filed under mysql, database, and latin1

I admit, I borrowed this from How to fix strange characters in MySQL database – Vinh Pham. But I also added a few more that were missing.

 
UPDATE <table> SET <field> = REPLACE(<field>, '’', '\'');
UPDATE <table> SET <field> = REPLACE(<field>, '…', '…');
UPDATE <table> SET <field> = REPLACE(<field>, '–', '-');
UPDATE <table> SET <field> = REPLACE(<field>, '“', '"');
UPDATE <table> SET <field> = REPLACE(<field>, '”', '"');
UPDATE <table> SET <field> = REPLACE(<field>, '‘', '\'');
UPDATE <table> SET <field> = REPLACE(<field>, '•', '-');
UPDATE <table> SET <field> = REPLACE(<field>, '‡', 'c');
UPDATE <table> SET <field> = REPLACE(<field>, 'â„¢', '™');
UPDATE <table> SET <field> = REPLACE(<field>, '®', '®');
 

Hopefully this helps someone (probably even me) sometime down the road!