From 6b7cf98034abe153e9f9bbe01c9f2d31bbb1c667 Mon Sep 17 00:00:00 2001 From: JHCD Date: Tue, 14 Jul 2015 19:11:54 +0200 Subject: [PATCH] make sure MySQL use utf-8 #63 --- plugins/MySQL/MySQL.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/MySQL/MySQL.py b/plugins/MySQL/MySQL.py index b480844..b965c5e 100644 --- a/plugins/MySQL/MySQL.py +++ b/plugins/MySQL/MySQL.py @@ -19,6 +19,7 @@ import mysql.connector from includes import globals # Global variables from includes.helper import configHandler +from includes.helper import uft8Converter # UTF-8 converter ## # @@ -71,7 +72,7 @@ def run(typ,freq,data): # Connect to MySQL # logging.debug("connect to MySQL") - connection = mysql.connector.connect(host = globals.config.get("MySQL","dbserver"), user = globals.config.get("MySQL","dbuser"), passwd = globals.config.get("MySQL","dbpassword"), db = globals.config.get("MySQL","database")) + connection = mysql.connector.connect(host = globals.config.get("MySQL","dbserver"), user = globals.config.get("MySQL","dbuser"), passwd = globals.config.get("MySQL","dbpassword"), db = globals.config.get("MySQL","database"), charset='utf8') cursor = connection.cursor() except: logging.error("cannot connect to MySQL")