Thanks much!

On Wed, Feb 15, 2012 at 14:42, Josiah Carlson <[email protected]>wrote:

> I ended up monkey-patching Jinja2 via the following function and replacing
> the code object on the original soft_unicode function:
>
> def soft_unicode(s):
>     if not isinstance(s, unicode):
>         try:
>             s = unicode(s, 'utf-8')
>         except UnicodeDecodeError:
>             s = unicode(s, 'latin-1')
>     return s
>
> from jinja2._markupsafe import _native
> _native.soft_unicode.func_code = soft_unicode.func_code
>
> Regards,
>  - Josiah
>
> --
> You received this message because you are subscribed to the Google Groups
> "pocoo-libs" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pocoo-libs/-/SmnBCjkD_uEJ.
> 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/pocoo-libs?hl=en.
>



-- 
Juancarlo *Añez*

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" 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/pocoo-libs?hl=en.

Reply via email to