Ticket #13139: patch.diff
File patch.diff, 670 bytes (added by , 15 years ago) |
---|
-
apps/django/forms/fields.py
a b 147 147 super(CharField, self).clean(value) 148 148 if value in EMPTY_VALUES: 149 149 return u'' 150 value = smart_unicode(value) 150 try: 151 value = smart_unicode(value) 152 except UnicodeDecodeError, e: 153 raise ValidationError(e) 151 154 value_length = len(value) 152 155 if self.max_length is not None and value_length > self.max_length: 153 156 raise ValidationError(self.error_messages['max_length'] % {'max': self.max_length, 'length': value_length})