Posts Tagged ‘mako’

Unicode in Mako using Pylons

Small post regarding unicode support in mako. I learned yesterday that mako not only has input and output encoding options but also an default_filter encoding. In the file, in your Pylons config folder, you need all these three to be sure that everything is enoded as unicode. Remember though that the default_filters argument can have big impact on performance.

(If someone knows the configuration files for other frameworks, please write a comment about it and I’ll add it to the post)

Please read the Mako unicode chapter here if you want the gory details.
 config['pylons.app_globals'].mako_lookup = TemplateLookup(
        default_filters=['decode.utf8'] )