title: iPhone - Retrieve non-english character values from sqlite
body: <p>I've just joined an iPhone project with a sqlite3 database.
  There's a custom localisation structure where values are stored in rows as follows:</p>
  
  <p><strong>Id, Country, Language, Key, Value</strong></p>
  
  <p>1469, FR, FR, KBUTTONS_AssessMyDamage, Évaluer le dommage</p>
  
  <p>The code we're using to pull out a result is:</p>
  
  <pre><code>NSString* item = @"";   
  
      sqlite3_stmt *statement;
          if (sqlite3_prepare_v2(database, [[NSString stringWithFormat:@"SELECT Value FROM LocalisedValues WHERE Country='%s' AND Language='%s' AND Key='%s'", country, language, key] UTF8String], -1, &amp;statement, nil) == SQLITE_OK) {
              while (sqlite3_step(statement) == SQLITE_ROW) {
  
                  item = [NSString stringWithUTF8String: (char *)sqlite3_column_text(statement, 0)];
  
              }
          }
  </code></pre>
  
  <p>The problem we're experiencing is that any result where the value column contains an accent, the É for example, returns nil. Removing the accented character returns correctly.</p>
  
  <p>The database itself appears to have been created as UTF8 (trying to retrieve values using the UTF16 method returns a single character).</p>
  
  <p>Does anyone have any ideas what could be going wrong with this?</p>