]> git.llucax.com Git - software/pymin.git/commitdiff
Convert serializer data to unicode in PyminDaemon (closes #28).
authorLeandro Lucarella <llucax@gmail.com>
Sun, 22 Jun 2008 05:07:34 +0000 (02:07 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Sun, 22 Jun 2008 05:10:16 +0000 (02:10 -0300)
pymin/pymindaemon.py

index 6f4fa736534147539873a93d2be8b5f3dcf3a635..6e080cb6e27deba19067b60bd469edb33f31924a 100644 (file)
@@ -114,13 +114,13 @@ class PyminDaemon(eventloop.EventLoop):
         try:
             result = self.dispatcher.dispatch(unicode(msg, 'utf-8'))
             if result is not None:
         try:
             result = self.dispatcher.dispatch(unicode(msg, 'utf-8'))
             if result is not None:
-                result = serializer.serialize(result)
+                result = unicode(serializer.serialize(result), 'utf-8')
             response = u'OK'
         except dispatcher.Error, e:
             result = unicode(e) + u'\n'
         except formencode.Invalid, e:
             if e.error_dict:
             response = u'OK'
         except dispatcher.Error, e:
             result = unicode(e) + u'\n'
         except formencode.Invalid, e:
             if e.error_dict:
-                result = serializer.serialize(e.error_dict)
+                result = unicode(serializer.serialize(e.error_dict), 'utf-8')
             else:
                 result = unicode(e) + u'\n'
         except Exception, e:
             else:
                 result = unicode(e) + u'\n'
         except Exception, e: