From 7aaf9091a2563f31165188df981b90fc728ac655 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 26 Jun 2010 18:35:07 -0400 Subject: [PATCH] Better Vallieres workaround: specify utf-8 charset ;) --- sitecore/prof/export_mysql.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sitecore/prof/export_mysql.py b/sitecore/prof/export_mysql.py index c629c46..ba6bece 100644 --- a/sitecore/prof/export_mysql.py +++ b/sitecore/prof/export_mysql.py @@ -56,7 +56,8 @@ class SimpleDB (object): self.logger.info('logging in to %s:%s as %s' % (host, database, username)) self.db = MySQLdb.connect(host=host, user=username, - passwd=password, db=database) + passwd=password, db=database, + charset='UTF8') del(username) del(password) self.cursor = self.db.cursor() @@ -68,7 +69,7 @@ class SimpleDB (object): def execute(self, command): self.logger.info(command) - self.cursor.execute(command) + self.cursor.execute(command.encode('utf-8')) def set_default_table(self, table): self.table = table @@ -169,8 +170,6 @@ Where the relevant categories are first_middle=prof['firstname'], last=prof['lastname'], ) - if p.name.last.encode('hex') == '56616c6c69e8726573': - p.name.last = u'Valli\xe8res' p.title = prof['position'] if prof['position1'] != None: p.title += ', %s' % prof['position1'] -- 2.26.2