The problem with the encoding of Russian characters sqlite

I execute a SELECT statement in a C # application, and Russian characters are returned as "?" symbol. The INSERT statement is working correctly.

the code:

SQLiteConnection sql_con = new SQLiteConnection(String.Format("Data Source={0}", local_db));
sql_con.Open();

string query = "SELECT * FROM models";
SQLiteCommand sql_cmd = new SQLiteCommand(query, sql_con);
sql_cmd.ExecuteNonQuery();
SQLiteDataReader reader = sql_cmd.ExecuteReader();

List<Model> all_models = new List<Model>();
while (reader.Read())
{
    Model m = new Model("");
    m.id = Convert.ToInt32(reader["id"]);
    m.name = Convert.ToString(reader["name"]);
    all_models.Add(m);
}

sql_con.Close();

All "name" parameters in the "Model" class are similar to "????????????"

Create table operator:

"CREATE TABLE models(id INT, name VARCHAR(100))"

Is this a problem with encoding or something else? How to fix it?

+3
source share

All Articles