Ticket #440: 440.1.patch

File 440.1.patch, 615 bytes (added by Maniac@…, 19 years ago)

patch for decoding data utf-8 -> unicode

  • formfields.py

     
    222222        self.validator_list = [self.isValidLength, self.hasNoNewlines] + validator_list
    223223
    224224    def isValidLength(self, data, form):
    225         if data and self.maxlength and len(data) > self.maxlength:
     225        if data and self.maxlength and len(data.decode('utf-8')) > self.maxlength:
    226226            raise validators.ValidationError, "Ensure your text is less than %s characters." % self.maxlength
    227227
    228228    def hasNoNewlines(self, data, form):
Back to Top