Set mysql character set to utf8 explicitly to support chinese characters (or other special characters).

This commit is contained in:
ColorfullyZhang 2021-09-16 14:41:24 +08:00
parent e6f4cdb584
commit 6009bba339
1 changed files with 1 additions and 0 deletions

View File

@ -102,6 +102,7 @@ bool zmDbConnect() {
if ( mysql_query(&dbconn, "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED") ) {
Error("Can't set isolation level: %s", mysql_error(&dbconn));
}
mysql_set_character_set(&dbconn, "utf8");
zmDbConnected = true;
return zmDbConnected;
}