How can I change the codepage I want to use on an operation such as the one below?
string foo = (string)sqlCommand.ExecuteScalar();
As I understand I can wrap the method call inside a String.Format(IFormatProvider, String)
. That would be grand.
But how do I construct a IFormatProvider with a specific codepage so I can correctly read this particular data from my database that is stored in a different codepage than the rest of the database file?
More information:
- The database is a SQLite database.
- Data is in Portuguese.
- Data that I'm adding to the database externally displays incorrectly on my application.
- Data that I add through my application displays correctly.
I think I traced it down to the fact I think I'm adding data in UTF-8 format when doing it through my application. I'm using System.Data.SQLite provider and I'm may investigate further how I can change this behavior. On any case, I would like for now to read data that is being inserted into the database from external sources, which is not in UTF-8 format.