diff --git a/src/engine/server/sql_server.cpp b/src/engine/server/sql_server.cpp index da59dfb57..d9a3c6ec0 100644 --- a/src/engine/server/sql_server.cpp +++ b/src/engine/server/sql_server.cpp @@ -112,6 +112,7 @@ bool CSqlServer::Connect() connection_properties["OPT_WRITE_TIMEOUT"] = 20; connection_properties["OPT_RECONNECT"] = true; connection_properties["OPT_CHARSET_NAME"] = sql::SQLString("utf8mb4"); + connection_properties["OPT_SET_CHARSET_NAME"] = sql::SQLString("utf8mb4"); // Create connection { @@ -123,6 +124,9 @@ bool CSqlServer::Connect() // Create Statement m_pStatement = m_pConnection->createStatement(); + // Apparently OPT_CHARSET_NAME and OPT_SET_CHARSET_NAME are not enough + m_pStatement->execute("SET CHARACTER SET utf8mb4;"); + if (m_SetUpDB) { char aBuf[128];