Ticket #5028: temporary_force_unicode_patch.patch

File temporary_force_unicode_patch.patch, 547 bytes (added by Peter Klein <petkle@…>, 17 years ago)

patch for 'elif not isinstance(s, unicode):'

  • 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 UnicodeError:
     45            s = unicode(s, 'latin-1', errors)
    4346    return s
    4447
    4548def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'):
Back to Top