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
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')