Use utf8mb4 instead of plain utf8 (#114)
This commit is contained in:
parent
62e550bf35
commit
1a47d7d80d
1 changed files with 3 additions and 1 deletions
|
@ -118,8 +118,10 @@ func RegisterTableStructsForCache(val interface{}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func initMysqlEngine() (engine *xorm.Engine, err error) {
|
func initMysqlEngine() (engine *xorm.Engine, err error) {
|
||||||
|
// We're using utf8mb here instead of just utf8 because we want to use non-BMP characters.
|
||||||
|
// See https://stackoverflow.com/a/30074553/10924593 for more info.
|
||||||
connStr := fmt.Sprintf(
|
connStr := fmt.Sprintf(
|
||||||
"%s:%s@tcp(%s)/%s?charset=utf8&parseTime=true",
|
"%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true",
|
||||||
config.DatabaseUser.GetString(),
|
config.DatabaseUser.GetString(),
|
||||||
config.DatabasePassword.GetString(),
|
config.DatabasePassword.GetString(),
|
||||||
config.DatabaseHost.GetString(),
|
config.DatabaseHost.GetString(),
|
||||||
|
|
Loading…
Reference in a new issue