On Sun, Jul 01, 2007 at 11:27:38AM -0300, Walter Cruz wrote:
> Well, I asked before search the in the list archives!
Sorry, no. If you like to continue the topic you brought up with another
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.
> What I needed:
>
> tmpl_options['mako.input_encoding'] = 'UTF-8'
> 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)
You shouldn't need the mako.default_filters setting. IMHO it slows done
things unnecessarily. The request_settings parameter does the work
already.
> In environment.py
>
> I changed my formencode validator to: UnicodeString and now it's ok.
Very good.
> But I'm with a doubt:
>
> 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?
You can't. A string contains 7-bit character in Python. So if you use
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.
Kindly
Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---