Ticket #5640: force_unicode.diff

File force_unicode.diff, 588 bytes (added by frank.hoffsummer@…, 17 years ago)

patch for utils.encoding.force_unicode

  • django/utils/encoding.py

     
    3939        else:
    4040            s = unicode(str(s), encoding, errors)
    4141    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')
    4346    return s
    4447
    4548def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'):
Back to Top