diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-02-16 17:13:48 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-02-16 17:13:48 +0200 |
commit | e133e66ac3255a3abf88e0bea5a9177f21a8bf0f (patch) | |
tree | d959840c0408959089ce3c0b5bcc8ffcf7379a22 /jtlib/app.py | |
parent | b362d4ddb335dda487417ff1a59e97946c2c2819 (diff) | |
download | jt-liw/nonascii.tar.gz |
Handle unicode more consistentlyliw/nonascii
Diffstat (limited to 'jtlib/app.py')
-rw-r--r-- | jtlib/app.py | 8 |
1 files changed, 6 insertions, 2 deletions
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) |