always provide unicode for rendering

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3434 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-06-29 09:32:05 +00:00
parent e1c163c887
commit 0048b02d99

View file

@ -340,11 +340,12 @@ class BaseView(GenericView, I18NView):
yield view yield view
def renderText(self, text, contentType): def renderText(self, text, contentType):
text = util.toUnicode(text)
typeKey = util.renderingFactories.get(contentType, None) typeKey = util.renderingFactories.get(contentType, None)
if typeKey is None: if typeKey is None:
if contentType == u'text/html': if contentType == u'text/html':
return util.toUnicode(text) return text
return u'<pre>%s</pre>' % util.html_quote(util.toUnicode(text)) return u'<pre>%s</pre>' % util.html_quote(text)
source = component.createObject(typeKey, text) source = component.createObject(typeKey, text)
view = component.getMultiAdapter((removeAllProxies(source), self.request)) view = component.getMultiAdapter((removeAllProxies(source), self.request))
return view.render() return view.render()