Changes between Version 1 and Version 2 of Ticket #21729, comment 2
- Timestamp:
- Feb 9, 2015, 7:23:27 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21729, comment 2
v1 v2 33 33 django.utils.encoding.DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 29: unexpected end of data. You passed in 'The Chesterfield brand Stor h\xc3' (<type 'str'>) 34 34 }}} 35 36 And here is my current workaround: 37 {{{ 38 class MyForm(forms.Form): 39 def _clean_fields(self, *args, **kwargs): 40 try: 41 return super(FeedRowForm, self)._clean_fields(*args, **kwargs) 42 except DjangoUnicodeDecodeError: 43 msg = "The data you povided is not encoded properly, please ensure you have valid UTF-8." 44 self._errors['__all__'] = self.error_class([msg]) 45 46 }}}