Ticket #3690: util.py.diff

File util.py.diff, 483 bytes (added by fback+django@…, 18 years ago)

proposed patch

  • util.py

    old new  
    1212        else:
    1313            s = unicode(str(s), settings.DEFAULT_CHARSET)
    1414    elif not isinstance(s, unicode):
    15         s = unicode(s, settings.DEFAULT_CHARSET)
     15        try:
     16            s = unicode(s, settings.DEFAULT_CHARSET)
     17       except UnicodeError:
     18           s = s.decode('ascii', 'replace')
    1619    return s
    1720
    1821
Back to Top