title: Codeigniter : Problem inserting accents in Mysql
body: <p>I'm trying out code igniter, and I came across an error message while trying to insert a new row in my Mysql database.</p>
  <p>The text I'm trying to insert is in French, and contains some accents.</p>
  <p>Here's my code :</p>
  <pre><code>    $data= array(
          'title' =&gt; $this-&gt;input-&gt;post('title'),
          'date' =&gt; $this-&gt;input-&gt;post('date'),
          'mytext' =&gt; $this-&gt;input-&gt;post('mytext')
          );
      
      $this-&gt;db-&gt;insert('blog', $data); 
  </code></pre>
  <p>This code seems to work fine (I've inserted a few &quot;test test&quot; entries), but when I try to enter something with accents, for instance &quot;<em>Il était là</em>&quot;, I get an error message :</p>
  <blockquote>
  <p>A Database Error Occurred</p>
  <p>Error Number: 1366</p>
  <p>Incorrect string value: '\xE9tait ...' for column 'mytext' at row 1</p>
  </blockquote>
  <p>I've looked on the code igniter forums for a fix, but all they say is to change the collation to UTF8, in mysql. I've tried that, but I keep having the same problem.</p>