As a PHP developer, I always use the code below whenever I want to work with PHP and MySQL on Unicode contents:
$link = mysql_connect("localhost","root") or die (mysql_error());
if ($link) {
mysql_set_charset('utf8',$link);
$db = mysql_select_db("mydb") or die (mysql_error());
}
In this case all contents will store exactly in MySQL database.
Now, I have a windows application written in C#.NET and I have to join it with MySQL database and store something in database through it. But all contents save as ??? marks.
How can I solve this problem ?
You need to tell your C# code that the MySQL database uses UTF8 encoding by including that information in your connection string, e.g.: