Set character set as utf8 when connect to mysql to avoid mistakes when there are Chinese characters in storage path.

This commit is contained in:
ColorfullyZhang 2021-09-16 18:24:37 +08:00 committed by Isaac Connor
parent 874552c06b
commit 9e4f203632
1 changed files with 1 additions and 0 deletions

View File

@ -107,6 +107,7 @@ sub zmDbConnect {
.$socket . $sslOptions . ($options?join(';', '', map { $_.'='.$$options{$_} } keys %{$options} ) : '') .$socket . $sslOptions . ($options?join(';', '', map { $_.'='.$$options{$_} } keys %{$options} ) : '')
, $ZoneMinder::Config::Config{ZM_DB_USER} , $ZoneMinder::Config::Config{ZM_DB_USER}
, $ZoneMinder::Config::Config{ZM_DB_PASS} , $ZoneMinder::Config::Config{ZM_DB_PASS}
, { mysql_enable_utf8 => 1, }
); );
}; };
if ( !$dbh or $@ ) { if ( !$dbh or $@ ) {