From b3bafc6aaee4b6b95c6aaefcc6f2e80eca6bd370 Mon Sep 17 00:00:00 2001 From: Florian Praden Date: Mon, 2 Feb 2015 15:25:24 +0100 Subject: m_mysql Add charset config option --- src/modules/extra/m_mysql.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 1cb3635bb..d8dda27a4 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -255,6 +255,12 @@ class SQLConnection : public SQLProvider bool rv = mysql_real_connect(connection, host.c_str(), user.c_str(), pass.c_str(), dbname.c_str(), port, NULL, 0); if (!rv) return rv; + + // Enable character set settings + std::string charset = config->getString("charset"); + if ((!charset.empty()) && (mysql_set_character_set(connection, charset.c_str()))) + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: Could not set character set to \"%s\"", charset.c_str()); + std::string initquery; if (config->readString("initialquery", initquery)) { -- cgit v1.2.3