title: Symfony2 LOWER DQL function and Character not in repertoire error
body: <p>I'm working with Symfony 2.3 and PostgreSQL 9.2. I just want to perform two simple queries, according to the value of a checkbox. Such queries are:</p>
  
  <pre><code>1) SELECT * FROM table WHERE field LIKE 'Something'
  2) SELECT * FROM table WHERE field ILIKE 'Something' 
  </code></pre>
  
  <p>As you know, the first is case sensitive, while the second is case insensitive.
  I know that in Doctrine ILIKE does not exist and that I should use the LOWER function. 
  However, if I specify some special characters in the query (for example 'è'), I get an error when I use the case insensitive version (that is, when using the LOWER function).</p>
  
  <p>In particular, the error I get is the following:</p>
  
  <pre><code>SQLSTATE[22021]: Character not in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF8": 0xe3 0xa8 0x20
  </code></pre>
  
  <p>Everything works fine when I do not use the LOWER function.
  I already checked the encoding and it is UTF8 for both the database and the client_encoding parameter of PostgreSQL.</p>
  
  <p>Any suggestion? Thank you</p>