On Nov 5, 2007, at 2:33 PM, Yannick Gingras wrote:
>
>
> Greetings Pyloneers,
> I'm hacking a plugin system for Gazest at the moment and I'm
> having a
> minor Unicode problem. The Pygments plugin returns an HTML fragment
> out of a Mako template, I render it with:
>
> pylons.render("/foo.mako", fruitsalad=pygments.highlight(...))
>
> All the other Gazest macros return Unicode object but render() returns
> an encoded string. I can simply decode it:
>
> unicode(pylons.render(...), "utf-8")
>
> But it seems strange to have mako produce a Unicode object, encode to
> utf-8 to decode it a moment later. Is it possible to have
> `pylons.render()` skip the encoding part and return the unicode object
> directly?
Most if not all Buffet plugins (I'm not sure about Genshi or breve's)
are pretty much hardcoded to only return raw strings. Unfortunately
this is just how it's always been done with Buffet.
The plans for an updated buffet are to advocate that plugins should
return unicode. That new buffet was scheduled to ship with Pylons
0.9.7, but there's no concrete implementation yet. There has been
some talk about it on pylons-devel
--
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
-~----------~----~----~----~------~----~------~--~---