title: SQL query using Firebird and foreign characters causes a malformed string error
body: <p>I have a simple example that is causing an error using Firebird SQL. </p>
  
  <p>I have a table with a column called Details which is defined as: </p>
  
  <pre><code>DETAILS varchar(261) COLLATE UNICODE
  </code></pre>
  
  <p>If I try to do the following query:</p>
  
  <pre><code>SELECT a.DETAILS
  FROM MODHISTORY a 
  WHERE
      a.DETAILS LIKE '%Â%'
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Error: *** IBPP::SQLException ***
  Context: Statement::Prepare( SELECT a.DETAILS
  FROM MODHISTORY a 
  WHERE
      a.DETAILS LIKE '%Â%'
   )
  Message: isc_dsql_prepare failed
  
  SQL Message : -104
  Invalid token
  
  Engine Code    : 335544849
  Engine Message :
  Malformed string
  </code></pre>
  
  <p>If I connect to the database using CHARSET=UTF8 in the connection string this error goes away but unfortunately I cannot use UTF8 as the character set when connecting to the database because some other tables contain, for example:</p>
  
  <pre><code>SampleData blob sub_type 1 CHARACTER SET ASCII,
  </code></pre>