I faced a very strange problem when developing on PHP and MySQL. I had such problem 4-5 years ago, but since than not. And really don't remember how I solved it.
Well... the problem: I'm having database with collation of utf_unicode_ci, but when inserting georgian letters: სახელი და გვარი in the database I'm having მიხეირ<- this symbols. What could the problem be? and how to solve it?
Any ideas?
According to Eray's answer I realized that utf8_general_ci shuld be set in collation and not utf8_unicode_ci
and in addition to that use mysql_set_charset('utf8', $connection) function.
Here's the sample:
$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
mysql_set_charset('utf8',$connection);
if (!$connection) {
die("Database connection failed: " . mysql_error());
} else {
$db_select = mysql_select_db(DB_NAME, $connection);
if (!$db_select) {
die("Database selection failed: " . mysql_error());
}
}
}
So having mysql_set_charset on the second line solved my issue.
Hope it helps anyone..