title: How to correct double-encoded UTF-8 strings sitting in MySQL utf8_general_ci fields?
body: <p>I have to redesign a class where (amongst other things) UTF-8 strings are double-encoded wrongly:</p>
  
  <pre><code>$string = iconv('ISO-8859-1', 'UTF-8', $string);
  :
  $string = utf8_encode($string);
  </code></pre>
  
  <p>These faulty strings have been saved into multiple table fields all over a MySQL database. All fields being affected use collation <code>utf8_general_ci</code>.</p>
  
  <p>Usually I'd setup a little PHP patch script, looping thru the affected tables, SELECTing the records, correct the faulty records by using <code>utf8_decode()</code> on the double-encoded fields and UPDATE them.</p>
  
  <p>As I got many and huge tables this time, and the error only affects german umlauts (äöüßÄÖÜ), I'm wondering if there's a solution smarter/faster than that.</p>
  
  <p>Are pure MySQL solutions like the following safe and recommendable?</p>
  
  <pre><code> UPDATE `table` SET `col` = REPLACE(`col`, 'Ã¤', 'ä');
  </code></pre>
  
  <p>Any other solutions/best practices?</p>