Trying to fix issue2550811, this only fixes the first part of it. Left to do is to find all places that need this translation, and possible places that break with it in place. bernhard@intevation.de diff -r 63c31b18b955 roundup/cgi/engine_jinja2.py --- a/roundup/cgi/engine_jinja2.py Sat Jan 17 21:06:04 2015 +0300 +++ b/roundup/cgi/engine_jinja2.py Tue Jan 20 23:09:32 2015 +0100 @@ -67,6 +67,11 @@ def precompile(self): pass + def tr(self, string): + """ Jinja2 (in version 2.7.2) only accepts unicode objects as input. + """ + return unicode(string, "utf-8") + class Jinja2ProxyPageTemplate(TemplateBase): def __init__(self, template): self._tpl = template diff -r 63c31b18b955 roundup/cgi/templating.py --- a/roundup/cgi/templating.py Sat Jan 17 21:06:04 2015 +0300 +++ b/roundup/cgi/templating.py Tue Jan 20 23:09:32 2015 +0100 @@ -106,6 +106,19 @@ """ raise NotImplementedError + def tr(self, string): + """ Translate roundup storage object string + into template input string object. + + Some template engines may need a different format or encoding + of the string they are getting back from the roundup storgage. + This function is ought to be used on all objects that shall + be rendered as strings. Roundup at 1.5.0 returns utf-8 encoded + string objects. A template engine that need something else + needs to overwrite this method. + """ + return string + class TALLoaderBase(LoaderBase): """ Common methods for the legacy TAL loaders.""" @@ -1216,6 +1229,7 @@ self._value = value self._anonymous = anonymous self._name = name + self._tr = client.instance.templates.tr if not anonymous: if nodeid: self._formname = '%s%s@%s'%(classname, nodeid, name) @@ -1406,7 +1420,7 @@ if not escape: s = cgi.escape(s) s = self.hyper_re.sub(self._hyper_repl, s) - return s + return self._tr(s) def wrapped(self, escape=1, hyperlink=1): """Render a "wrapped" representation of the property.