diff --git a/util.py b/util.py index d28790b..4e0c09f 100644 --- a/util.py +++ b/util.py @@ -67,3 +67,10 @@ def getUidForObject(obj): return '*' intIds = component.getUtility(IIntIds) return str(intIds.queryId(obj)) + + +def toUnicode(text): + if type(text) is not unicode: + return text.decode('UTF-8') + else: + return text diff --git a/xmlrpc/common.py b/xmlrpc/common.py index 6421f4e..f84d419 100644 --- a/xmlrpc/common.py +++ b/xmlrpc/common.py @@ -32,7 +32,7 @@ from zope.security.proxy import removeSecurityProxy from zope.cachedescriptors.property import Lazy from loops.concept import Concept -from loops.util import getUidForObject, getObjectForUid +from loops.util import getUidForObject, getObjectForUid, toUnicode class LoopsMethods(MethodPublisher): """ XML-RPC methods for the loops root object. @@ -113,6 +113,7 @@ class LoopsMethods(MethodPublisher): def createConcept(self, typeId, name, title): type = getObjectForUid(typeId) + title = toUnicode(title) c = self.concepts[name] = Concept(title) c.conceptType = type notify(ObjectCreatedEvent(c))