title: Debugging a MySQL charset error
body: <p>I have a project where I scrape some data from a HTML file, put it into a MySQL database and then read it out again and display it to the user. Whenever the servlet is inserting something into the DB the "£" sign is being inserted as a � and when read out again presented as that.</p>
  
  <p>The application is written in Java (with Spring) and JPA with EclipseLink as the JPA implementation.</p>
  
  <p>I have narrowed down the problem to the insertion into MySQL since when I view the table in the console the question mark appears.</p>
  
  <p>I have configured MySQL to use UTF-8 as the standard encoding in my.cnf</p>
  
  <pre><code>[mysqld]
  default-character-set=utf8
  </code></pre>
  
  <p>If I run </p>
  
  <pre><code>SHOW TABLE STATUS;
  </code></pre>
  
  <p>I can see that the collation on the tables is</p>
  
  <pre><code>utf8_general_ci
  </code></pre>
  
  <p>which suggests that the char set is also UTF-8.</p>
  
  <p>Also there is this:
  mysql> SHOW CREATE DATABASE gate;</p>
  
  <pre><code>+----------+---------------------------------------------------------------+
  | Database | Create Database                                               |
  +----------+---------------------------------------------------------------+
  | gate     | CREATE DATABASE `gate` /*!40100 DEFAULT CHARACTER SET utf8 */ | 
  +----------+---------------------------------------------------------------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>So, with Java being fully unicode(?) and my DB being set to UTF-8 where could I look for misconfigurations/errors?</p>