Jinja2 was not working with Russian strings stored in SQLite.

Ubuntu 10.04
Python 2.6.5
mitsuhiko-flask-8ed051d

The following corrections to eliminate possible errors:
In file: /jinja2/_markupsafe/_native.py
was:
    return Markup(s)
        .replace('&', '&')
        .replace('>', '>')
        .replace('<', '&lt;')
        .replace("'", '&#39;')
        .replace('"', '&#34;')
    )
become:
    return Markup(s if type(s)!=type("") else s.decode("utf-8") \
        .replace('&', '&amp;')
        .replace('>', '&gt;')
        .replace('<', '&lt;')
        .replace("'", '&#39;')
        .replace('"', '&#34;')
    )

In the file /jinja2/_markupsafe/__init__.py:
was:
    return unicode.__new__(cls, base)
become:
    return unicode.__new__(cls, base if type(base)!=type("") \
        else base.decode("utf-8"))

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