title: Encoding on database content not working
body: <p>I'm currently having some charset problems, that I can't solve myself. My problem is, that when I use some special characters, I just get a "�"</p>
  
  <p>It is ONLY on database content - so content written directly in my view files is shown correctly, but when it is coming from a database, it gives the above problem.</p>
  
  <p>Does anyone know what I maybe should look for? At the moment I haven't got any more ideas myself.</p>
  
  <h2>SOLLUTION</h2>
  
  <p>Changing my connection line to PDO from:</p>
  
  <pre><code>self::$_db = new PDO(self::$DB_type .':host='. self::$DB_hostname .';dbname='. self::$DB_database, self::$DB_username, self::$DB_pass );
  </code></pre>
  
  <p>And simply add the charset - so the connection line is as following:</p>
  
  <pre><code>$options = array(PDO::MYSQL_ATTR_INIT_COMMAND =&gt; 'SET NAMES utf8');
  self::$_db = new PDO(self::$DB_type .':host='. self::$DB_hostname .';dbname='. self::$DB_database, self::$DB_username, self::$DB_pass, $options );
  </code></pre>
  
  <p>Thanks in advance!</p>