Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue with

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

when rendering template within non-ASCII strings (non-unicodes)
  • Loading branch information...
commit 17af9b5a9d5a77c1f0c1ec296bfaa6220cb62876 1 parent 21a2010
@vintozver authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  jinja2/_markupsafe/_native.py
View
2  jinja2/_markupsafe/_native.py
@@ -40,6 +40,8 @@ def soft_unicode(s):
"""Make a string unicode if it isn't already. That way a markup
string is not converted back to unicode.
"""
+ if isinstance(s, str):
+ s = s.decode('utf-8')
if not isinstance(s, unicode):
s = unicode(s)
return s
Please sign in to comment.
Something went wrong with that request. Please try again.