Django

Code

Ticket #3314: util.diff

File util.diff, 0.6 kB (added by nesh <nesh [at] studioquattro [dot] co [dot] yu>, 2 years ago)

fast fix

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

    old new  
    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