Merge pull request #3355 from ColorfullyZhang/master
Set mysql character set to utf8 explicitly
This commit is contained in:
commit
1700e2f919
|
@ -107,6 +107,7 @@ sub zmDbConnect {
|
|||
.$socket . $sslOptions . ($options?join(';', '', map { $_.'='.$$options{$_} } keys %{$options} ) : '')
|
||||
, $ZoneMinder::Config::Config{ZM_DB_USER}
|
||||
, $ZoneMinder::Config::Config{ZM_DB_PASS}
|
||||
, { mysql_enable_utf8 => 1, }
|
||||
);
|
||||
};
|
||||
if ( !$dbh or $@ ) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue