mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 19:56:43 +08:00
MYSQL defaults to UTF-8
This commit is contained in:
parent
33e848f7e9
commit
5afa9ae919
@ -17,7 +17,12 @@ namespace SqlSugar
|
||||
{
|
||||
if (base._DbConnection == null)
|
||||
{
|
||||
base._DbConnection = new MySqlConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
var mySqlConnectionString = base.Context.CurrentConnectionConfig.ConnectionString;
|
||||
if (!mySqlConnectionString.ToLower().Contains("charset"))
|
||||
{
|
||||
mySqlConnectionString=mySqlConnectionString.Trim().TrimEnd(';') + ";charset=utf8;";
|
||||
}
|
||||
base._DbConnection = new MySqlConnection(mySqlConnectionString);
|
||||
}
|
||||
return base._DbConnection;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user