.NET MySql connector utf8 issue

My schema, table and varchar columns have a collation utf8 - utf8_turkish_ci and I am trying to insert turkish specific characters into a varchar(200) column.

My query is like below

insert into categories (name) values ('ışığı')

When I execute this query via MySql Workbench everything is fine.

But when I execute this query using MySqlClient ışığı is inserted as isigi . Somehow turkish charaters are get lost.

MySqlConnection conn = new MySqlConnection(connStr);
conn.Open();
MySqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "insert into categories (name) values ('ışığı')";
cmd.ExecuteNonQuery();

I also tried executing SET NAMES UTF8 before insert but it did not work.

NOTE: I do not have access to mysql configuration files, only MySql Workbench.

链接地址: http://www.djcxy.com/p/60978.html

上一篇: 是否有Visual Studio 2012的mySQL连接器?

下一篇: .NET MySql连接器的utf8问题