On Wed, May 09, 2007 at 11:18:12AM -0700, KyleJ 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.
> 
> >From the Mako docs ( 
> >http://www.makotemplates.org/docs/unicode.html#unicode_handling
> ):
> "Note that the built-in decode object is slower than the unicode
> function, since unlike unicode its not a Python builtin, and it also
> checks the type of the incoming data to determine if string conversion
> is needed first."
> 
> If you comment that out and you start getting unicode errors, it's
> likely because your strings aren't being converted to unicode objects.

I had trouble indeed. But I'm willing to come back if that's happening
again.

> You can either decode them yourself (one variable at a time
> via .decode('utf-8')  ), or you can have request.params output to
> unicode (see 
> http://pylonshq.com/project/pylonshq/browser/Pylons/trunk/docs/internationalization.txt#L516
> ) along with SQLAlchemy (use_unicode=True in either create_engine or
> make_session).

Where (in a standard Pylons project) would I set use_unicode=True? I
just found references to "create_engine" in the websetup.py which is
obviously not the right place. And my models/__init__.py just has the
line

    meta = DynamicMetaData()

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

Reply via email to