Open template as utf8 file
This commit is contained in:
parent
2f4dec45a6
commit
a96ff8399f
1 changed files with 1 additions and 1 deletions
|
@ -288,7 +288,7 @@ class UiRequest(object):
|
||||||
|
|
||||||
# Renders a template
|
# Renders a template
|
||||||
def render(self, template_path, *args, **kwargs):
|
def render(self, template_path, *args, **kwargs):
|
||||||
template = open(template_path).read()
|
template = open(template_path, encoding="utf8").read()
|
||||||
for key, val in list(kwargs.items()):
|
for key, val in list(kwargs.items()):
|
||||||
template = template.replace("{%s}" % key, "%s" % val)
|
template = template.replace("{%s}" % key, "%s" % val)
|
||||||
return template.encode("utf8")
|
return template.encode("utf8")
|
||||||
|
|
Loading…
Reference in a new issue