mako 中文乱码问题
python 源码是
from mako.lookup import TemplateLookup
from mako.template import Template
_lookup = TemplateLookup( directories=['D:/PythonWeb/JavaCardProjectWeb/templates'],
input_encoding='utf-8',
output_encoding='utf-8',
default_filters=['decode.utf_8'])
tem = _lookup.get_template('footer.html')
print tem.render()
mytemplate = Template(filename='D:/PythonWeb/JavaCardProjectWeb/templates/footer.html')
print mytemplate.render()
## -*- coding: utf-8 -*-
<div class="footer" role="contentinfo">
<div id="colophon">
<div id="site-generator">
© 2012 BigYuki.
<a href="http://code.google.com/appengine/"
title="Semantic Personal Publishing Platform"
rel="generator">
Proudly powered by Google App Engine. 谢谢了
</a>
</div>
<!-- #site-generator -->
<div id="site-info"> Designed by <a href="http://www.gauson.com">Gauson Design</a> </div>
<!-- #site-info -->
</div>
<!-- #colophon -->
</div>