title: PHP: Problems converting "’" character from ISO-8859-1 to UTF-8
body: <p>I'm having some issues with using PHP to convert ISO-8859-1 database content to UTF-8. I am running the following code to test:</p>
  
  <pre><code>// Connect to a latin1 charset database 
  // and retrieve "Georgia O’Keeffe", which contains a "’" character
  $connection = mysql_connect('*****', '*****', '*****');
  mysql_select_db('*****', $connection);
  mysql_set_charset('latin1', $connection);
  $result = mysql_query('SELECT notes FROM categories WHERE id = 16', $connection);
  $latin1Str = mysql_result($result, 0);
  $latin1Str = substr($latin1Str, strpos($latin1Str, 'Georgia'), 16);
  
  // Try to convert it to UTF-8
  $utf8Str = iconv('ISO-8859-1', 'UTF-8', $latin1Str);
  
  // Output both
  var_dump($latin1Str);
  var_dump($utf8Str);
  </code></pre>
  
  <p>When I run this in Firefox's source view, making sure Firefox's encoding setting is set to "Western (ISO-8859-1)", I get this:</p>
  
  <p><img src="https://imgur.com/ms0xh.png" alt="asd"></p>
  
  <p>So far, so good. The first output contains that weird quote and I can see it correctly because it's in ISO-8859-1 and so is Firefox.</p>
  
  <p>After I change Firefox's encoding setting to "UTF-8", it looks like this:</p>
  
  <p><img src="https://imgur.com/7djDD.png" alt="asd"></p>
  
  <p>Where did the quote go? Wasn't <code>iconv()</code> supposed to convert it to UTF-8?</p>