Blob Blame History Raw
From ecc33fc211b904c5aa0c88647245d37fe8cd7338 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Fri, 16 Oct 2015 16:03:55 -0400
Subject: [PATCH] Use mako's render_unicode method.

This avoids tw2 playing a role in unnecessarily coercing strings to from
unicode to bytestrings and back again.  We can just keep things unicode
until the very last moment.
---
 tw2/core/templating.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tw2/core/templating.py b/tw2/core/templating.py
index f71a2a3..f6e9c6f 100644
--- a/tw2/core/templating.py
+++ b/tw2/core/templating.py
@@ -146,7 +146,7 @@ def get_render_callable(engine_name, displays_on, src, filename=None, inline=Fal
                 directories=[directory])
 
         tmpl = mako.template.Template(**args)
-        return lambda kwargs: Markup(tmpl.render(**kwargs))
+        return lambda kwargs: Markup(tmpl.render_unicode(**kwargs))
 
     elif engine_name in ('genshi', 'genshi_abs'):
         import genshi.template
-- 
2.4.3