[FIX] base: ir.qweb: ensure element.tail is correctly encoded

element.{text,tail} are either ascii-compatible `str`, or `unicode`
when non-ascii-compatible. This could force the implicit decoding
of utf-8 encoded contents when joining template bits, breaking
the rendering.

Fixes #1085, and related to #1130
This commit is contained in:
Christophe Combelles 2014-07-10 17:47:06 +03:00 committed by Olivier Dony
parent 64ed698a58
commit b64bd885b0
1 changed files with 1 additions and 1 deletions

View File

@ -289,7 +289,7 @@ class QWeb(orm.AbstractModel):
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
if element.tail:
result += element.tail
result += element.tail.encode('utf-8')
if isinstance(result, unicode):
return result.encode('utf-8')