Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support UTF-8 encoding in templates #17

Closed
w0rm opened this Issue · 2 comments

3 participants

@w0rm

This raises UnicodeDecodeError:
test.py:

import web, os 
render = web.template.render(os.path.abspath(os.path.dirname(__file__))) 
render.test() 

test.html:

$var array = [u"один", u"два", u"три"] 
$ test = u"один" 
<p>just a test</p>

To fix it I had to change line 1011 in _load_template in template.py to this:

return Template(open(path).read().decode("utf-8"), filename=path, **self._keywords)
@s7v7nislands

if using other encoding, how to do? webpy seems only support 'utf-8' and not well!

@anandology
Collaborator

fixed unicode encoding issue in templates. (closed by 6c1ae13)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.