Ticket #3344: decode-before-unicode.patch

File decode-before-unicode.patch, 539 bytes (added by Øyvind Saltvik <oyvind.saltvik@…>, 18 years ago)

utf-8 decode before unicode , attached patch to wrong ticket

  • django/newforms/util.py

     
    1010        if hasattr(s, '__unicode__'):
    1111            s = unicode(s)
    1212        else:
    13             s = unicode(str(s), settings.DEFAULT_CHARSET)
     13            s = unicode(str(s).decode(settings.DEFAULT_CHARSET), settings.DEFAULT_CHARSET)
    1414    elif not isinstance(s, unicode):
    1515        s = unicode(s, settings.DEFAULT_CHARSET)
    1616    return s
Back to Top