From e133e66ac3255a3abf88e0bea5a9177f21a8bf0f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 16 Feb 2016 17:13:48 +0200 Subject: Handle unicode more consistently --- jtlib/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'jtlib/app.py') diff --git a/jtlib/app.py b/jtlib/app.py index ad0d7a3..ddbb94a 100644 --- a/jtlib/app.py +++ b/jtlib/app.py @@ -134,5 +134,9 @@ class JournalTool(cliapp.Application): def render_template(self, basename, vars): text = self.read_template(basename) - template = jinja2.Template(text) - return template.render(**vars) + utext = unicode(text, 'utf8') + uvars = dict( + (unicode(k, 'utf8'), unicode(v, 'utf8')) + for k, v in vars.items()) + template = jinja2.Template(utext) + return template.render(**uvars) -- cgit v1.2.1