Ticket #3314: util.diff

File util.diff, 591 bytes (added by nesh <nesh [at] studioquattro [dot] co [dot] yu>, 18 years ago)

fast fix

  • www-libs/django/django/newforms/util.py

     
    22
    33def smart_unicode(s):
    44    if not isinstance(s, basestring):
    5         s = unicode(str(s))
     5        try:
     6            s = unicode(str(s))
     7        except UnicodeDecodeError:
     8            s = unicode(str(s), settings.DEFAULT_CHARSET)
    69    elif not isinstance(s, unicode):
    710        s = unicode(s, settings.DEFAULT_CHARSET)
    811    return s
Back to Top