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:
parent
e1c163c887
commit
0048b02d99
1 changed files with 3 additions and 2 deletions
|
@ -340,11 +340,12 @@ class BaseView(GenericView, I18NView):
|
|||
yield view
|
||||
|
||||
def renderText(self, text, contentType):
|
||||
text = util.toUnicode(text)
|
||||
typeKey = util.renderingFactories.get(contentType, None)
|
||||
if typeKey is None:
|
||||
if contentType == u'text/html':
|
||||
return util.toUnicode(text)
|
||||
return u'<pre>%s</pre>' % util.html_quote(util.toUnicode(text))
|
||||
return text
|
||||
return u'<pre>%s</pre>' % util.html_quote(text)
|
||||
source = component.createObject(typeKey, text)
|
||||
view = component.getMultiAdapter((removeAllProxies(source), self.request))
|
||||
return view.render()
|
||||
|
|
Loading…
Add table
Reference in a new issue