| |
pylons-discuss |
> tmpl_options['mako.input_encoding'] = 'UTF-8' > I changed my formencode validator to: UnicodeString and now it's ok. > Even with this, in my templates I've to use: > ${h.link_to(u"Nova citação", h.url(action="new"))} > (Note the u before "Nova citação"). > How can I configure this to avoid to say that this is string is unicode? Kindly
> Well, I asked before search the in the list archives!
thread then please use the other thread. I didn't follow the other
thread. If you start a new thread then I recommend you put all necessary
information into it.
> tmpl_options['mako.output_encoding'] = 'UTF-8'
> tmpl_options['mako.default_filters'] = ['decode.utf8']
> request_settings = dict(charset='utf-8', errors='replace')
> return pylons.config.Config(tmpl_options, map,
> paths,request_settings=request_settings)
things unnecessarily. The request_settings parameter does the work
already.
anything besides 7-bit ASCII you need to use unicode objects. Generally
(not only with Pylons) it's wise to always use Unicode internally and
just convert them on input/output. Trust me - it will save you time and
hassle.
Christoph