Hi, I just installed the new release 0.9.6rc1 but found the utf-8 not
supported well in template. I created a mako file index.mao simply
contains "測試" (which means test in Chinese"), went to the address, and
got an error below. Do I need to set something by self? Thanks.

Error !
CompileException: Could not read template using encoding of 'ascii'.
Did you forget a magic encoding comment? in file 'D:\Workspace
\pylonsrc1\pylonsrc1\templates/index.mao' at line: 0 char: 0
1 測試
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\lexer.py, line
140:
raise exceptions.CompileException("Could not read template using
encoding of 'ascii'. Did you forget a magic encoding comment?",
self.text.decode('utf-8', 'ignore'), 0, 0, self.filename)
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\template.py,
line 205:
node = lexer.parse()
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\template.py,
line 73:
_compile_module_file(self, file(filename).read(), filename, path)
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\lookup.py,
line 112:
self.__collection[uri] = Template(uri=uri,
filename=posixpath.normpath(filename), lookup=self,
module_filename=(self.modulename_callable is not None and
self.modulename_callable(filename, uri) or None),
**self.template_args)
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\lookup.py,
line 70:
return self.__load(srcfile, uri)
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\ext
\turbogears.py, line 39:
return self.lookup.get_template(templatename)
c:\python25\lib\site-packages\mako-0.1.8-py2.5.egg\mako\ext
\turbogears.py, line 43:
template = self.load_template(template)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\templating.py, line 225:
**options)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\templating.py, line 338:
format=format, namespace=kargs, **cache_args)
D:\Workspace\pylonsrc1\pylonsrc1\controllers\root.py, line 15:
return render('/index.mao')
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\controllers.py, line 133:
result = func(**args)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\controllers.py, line 167:
response = self._inspect_call(func)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\controllers.py, line 212:
response = self._dispatch_call()
D:\Workspace\pylonsrc1\pylonsrc1\lib\base.py, line 23:
return WSGIController.__call__(self, environ, start_response)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\wsgiapp.py, line 214:
return controller(environ, start_response)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\wsgiapp.py, line 88:
response = self.dispatch(controller, environ, start_response)
c:\python25\lib\site-packages\routes-1.7-py2.5.egg\routes
\middleware.py, line 104:
response = self.app(environ, start_response)
c:\python25\lib\site-packages\beaker-0.7.4-py2.5.egg\beaker
\session.py, line 393:
response = self.wrap_app(environ, session_start_response)
c:\python25\lib\site-packages\beaker-0.7.4-py2.5.egg\beaker\cache.py,
line 180:
return self.app(environ, start_response)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\wsgiapp.py, line 292:
return self.app(environ, start_response)
c:\python25\lib\site-packages\pylons-0.9.6rc1-py2.5.egg\pylons
\error.py, line 245:
app_iter = self.application(environ, detect_start_response)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to