title: PDO UTF-8 encoding issue?
body: <p>i am using PDO for connecting to MYSQL database</p>
  
  <p>all tables in database have <strong>utf8_unicode_ci</strong> Collation</p>
  
  <p><strong>here is my connection code :</strong> </p>
  
  <pre><code>&lt;?php
  $mysql_username = "root";
  $mysql_password = "";
  $mysql_host = "localhost";
  $mysql_database = "cms";
  
  try
  {
      //connect
      global $db;
      $db = new PDO('mysql:dbname=' . $mysql_database . ';host=' . $mysql_host . ';charset=utf8;', $mysql_username, $mysql_password);
      $db-&gt;setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES utf8');
      $db-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
      $db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  }
  catch(PDOException $ex)
  {
      die("Unable Connect To DataBase");
  }
  ?&gt;
  </code></pre>
  
  <p>in localhost i have no problem with encoding but when i uploaded the source to a host i see <strong>??????</strong> instead of characters?</p>