From 1a47d7d80d0fe3e59f83c04c37f5f9264ed68d73 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 7 Dec 2019 20:14:13 +0000 Subject: [PATCH] Use utf8mb4 instead of plain utf8 (#114) --- pkg/db/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/db/db.go b/pkg/db/db.go index 23f3e1a6d2..ce2e719e48 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -118,8 +118,10 @@ func RegisterTableStructsForCache(val interface{}) { } 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( - "%s:%s@tcp(%s)/%s?charset=utf8&parseTime=true", + "%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true", config.DatabaseUser.GetString(), config.DatabasePassword.GetString(), config.DatabaseHost.GetString(),