私は次のファイルを持っています
ダミー.py
#!c:/Python27/python.exe -u
from mako import exceptions
from mako.template import Template
print "Content-type: text/html"
print
#VARIABLE = "WE"
VARIABLE = "我们"
template = Template(filename='../template/dummy.html', output_encoding='utf8')
try:
print template.render(VARIABLE=VARIABLE)
except:
print exceptions.html_error_template().render()
ダミー.html(UTF-8形式で保存)
hello world
哈罗世界
${VARIABLE}
http://www.makotemplates.org/docs/unicode.htmlからの指示を参照しました
ただし、それでもエラーが発生します
UnicodeDecodeError:'ascii'コーデックは位置0のバイト0xe6をデコードできません:序数が範囲内にありません(128)
私が見逃したものはありますか?