title: UTF-8 and ISO-8859-1: Why does it work for the most of the time and why sometimes not?
body: <p>I have a osCommerce 2.2 MST which has some custom additions to it. osCommerce itself is in ISO-8859-1. The addition has a table in a MySQL database which is now in utf8_general_ci (the others are all in latin1_swedish_ci). The php-file I'm calling outputs</p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
  </code></pre>
  
  <p>As I mentioned before the data from the database is in UTF-8. But letters like ö,ä,ü are correct displayed. How can this be? There should be no <code>utf8_decode</code>. But the letter č is displayed as <code>?</code>. I get this directly as result array. If I make the query with phpmyadmin it is correct displayed.</p>
  
  <p>I managed to get all letters correct displayed (only in one section of the script). This is what I made</p>
  
  <pre><code>mysql_query("SET NAMES 'utf8'"); 
  </code></pre>
  
  <p>In the php-script I also added</p>
  
  <pre><code>header('content-type: text/html; charset=utf-8');
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt;
  </code></pre>
  
  <p>But then other problems occured.</p>
  
  <p>What I want to know why data in UTF-8 is "correctly" displayed when it should be not. And how do I get the letter č correctly displayed?</p>
  
  <p>The system is I find rather complex. Where and how can I look what is wrong here?</p>