Hello guys, I'm trying to use mako with unicode, but I get the
following error:

mako.exceptions.CompileException: Unicode decode operation of encoding
'utf-8' failed in file 'foo.txt' at line: 0 char: 0

I read the mako documentation and tried the following example:

# -*- coding: utf-8 -*-

from mako.template import Template
from mako.lookup import TemplateLookup

def main():
    mylookup = TemplateLookup(directories=["."])
    mytemplate = mylookup.get_template("foo.txt")
    print mytemplate.render()

if __name__ == "__main__":
    main()

The foo.txt file is written as follows:

# -*- coding: utf-8 -*-
Jesús Antonio

Any help will be very appreciated.


--~--~---------~--~----~------------~-------~--~----~
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