title: Solving UTF8 & french accents incompatibility
body: <p>I have a PHP script which saves user content into a mysql database (PHP 5.4, mysql 5.5.31)</p>
  
  <p>All string-related fields in my database have <code>utf8_unicode_ci</code> as collation.</p>
  
  <p>My (simplified) code looks like this:</p>
  
  <pre><code>$db_handle = mysql_connect('localhost', 'username', 'password');
  mysql_select_db('my_db');
  
  mysql_set_charset('utf8', $db_handle);
  
  // ------ INSERT: First example -------
  $s   = "je viens de télécharger et installer le logiciel";
  $sql = "INSERT INTO my_table (post_id, post_subject, post_text) VALUES (1, 'subject 1', '$s')";
  mysql_query($sql, $db_handle);
  
  // ------ INSERT: Second example -------
  $s   = "EPrints and العربية";
  $sql = "INSERT INTO my_table (post_id, post_subject, post_text) VALUES (2, 'subject 2', '$s')";
  mysql_query($sql, $db_handle);
  // ------------- 
  
  mysql_close($db_handle);
  </code></pre>
  
  <p>The problem is, the first insert (latin text with the <code>é</code> accents) fails unless I comment this line:</p>
  
  <pre><code>mysql_set_charset('utf8', $db_handle);
  </code></pre>
  
  <p>But the second query (mix of latin &amp; arabic content) will fail unless I call <code>mysql_set_charset('utf8', $db_handle);</code></p>
  
  <p>I've been struggling with this for 2 days now. I thought UTF8 does support characters like the french accents, but obviously it doesn't!</p>
  
  <p>How can I fix this?</p>