Ticket #5640: force_unicode.diff
File force_unicode.diff, 588 bytes (added by , 17 years ago) |
---|
-
django/utils/encoding.py
39 39 else: 40 40 s = unicode(str(s), encoding, errors) 41 41 elif not isinstance(s, unicode): 42 s = unicode(s, encoding, errors) 42 try: 43 s = unicode(s, encoding, errors) 44 except UnicodeDecodeError: 45 s = unicode(s, encoding, 'ignore') 43 46 return s 44 47 45 48 def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'):