From: W. Trevor King Date: Sat, 26 Jun 2010 22:35:07 +0000 (-0400) Subject: Better Vallieres workaround: specify utf-8 charset ;) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7aaf9091a2563f31165188df981b90fc728ac655;p=sitecorepy.git Better Vallieres workaround: specify utf-8 charset ;) --- 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']