From 71ae754fcd399e1dc55e32d514dfdb22a7fdcea0 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 4 Dec 2015 11:16:15 -0600 Subject: [PATCH] fixed #1110, allow passing unicode to template render --- gluon/template.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gluon/template.py b/gluon/template.py index 34b0d415..3bbae113 100644 --- a/gluon/template.py +++ b/gluon/template.py @@ -898,6 +898,9 @@ def render(content="hello world", if not 'NOESCAPE' in context: context['NOESCAPE'] = NOESCAPE + if isinstance(content, unicode): + content = content.encode('utf8') + # save current response class if context and 'response' in context: old_response_body = context['response'].body