On May 10, 2007, at 2:37 AM, Max Ischenko wrote:
> > > On 5/9/07, KyleJ <[EMAIL PROTECTED]> wrote: > On May 5, 3:08 am, Christoph Haas <[EMAIL PROTECTED]> wrote: > > tmpl_options['mako.default_filters'] = ['decode.utf8'] > > You may wish to not use that option. > > Second this. > > I have *no* tmpl_options for Mako and it just works. Passing utf8- > encoded strings to Mako template violates the basic i18n rule of > "use Unicode thoughtout your code and convert on I/O". > > I'd ask to update the cookbook doc to reflect this. > One thing I see mentioned a lot for both mako and myghty is the need to set: tmpl_options['engine.output_encoding'] = 'utf-8' This is totally unnecessary in Pylons, as Pylons automatically sets this value for mako and myghty to Config's response_settings ['charset'] value (which defaults to utf-8). That variable and response_settings['content_type'] (defaulting to text/html) dictate what's set as the outgoing Content-Type header, i.e.: Content-Type: text/html; charset=utf-8 So if you're intending to send outgoing utf-8 data, the idea is Pylons automatically sets your templating engine to output to that encoding. It doesn't do this for every templating engine though (I think it does it for kid). -- Philip Jenvey --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
