There are two things that you need to do to support UTF-8 in the ADO.NET Entity frame work (or in general using the MySQL .NET Connector):
- Ensure that the collation of your database of table is a UTF-8 collation (i.e.
utf8_general_ci
or one of its relations) -
Add
Charset=utf8;
to your connection string."Server=localhost;Database=test;Uid=test;Pwd=test;Charset=utf8;"
I’m not certain, but the encoding may be case sensitive; I found that CharSet=UTF8;
did not work for me.