﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2909	Invalid utf-8 decode errors handling	jiivan	Adrian Holovaty	"when user submits invalid utf-8 string for example {{{ \xe4 }}} basic validators are throwing exceptions.

Here is quick and dirty solution:
{{{
#!python

--- core/formfields.py  2006-10-13 16:39:12.000000000 +0200
+++ core/formfields.py.orig     2006-10-13 14:53:00.000000000 +0200
@@ -329,7 +329,7 @@
         self.field_name = field_name
         self.length, self.maxlength = length, maxlength
         self.is_required = is_required
-        self.validator_list = [validators.isValidUTF8, self.hasNoNewlines, self.isValidLength] + validator_list
+        self.validator_list = [self.isValidLength, self.hasNoNewlines] + validator_list
         if member_name != None:
             self.member_name = member_name

@@ -365,7 +365,7 @@
     def __init__(self, field_name, rows=10, cols=40, is_required=False, validator_list=[], maxlength=None):
         self.field_name = field_name
         self.rows, self.cols, self.is_required = rows, cols, is_required
-        self.validator_list = [validators.isValidUTF8] + validator_list
+        self.validator_list = validator_list[:]
         if maxlength:
             self.validator_list.append(self.isValidLength)
             self.maxlength = maxlength

--- core/validators.py  2006-10-13 16:40:15.000000000 +0200
+++ core/validators.py.orig     2006-10-13 14:52:47.000000000 +0200
@@ -56,12 +56,6 @@
     def __str__(self):
         return str(self.messages)

-def isValidUTF8(field_data, all_data):
-    try:
-        field_data.decode('utf-8')
-    except UnicodeDecodeError, e:
-        raise CriticalValidationError(""Błąd kodowania UTF-8: %s, przy znakach %d-%d"" % (e.reason, e.start, e.end))
-
 def isAlphaNumeric(field_data, all_data):
     if not alnum_re.search(field_data):
         raise ValidationError, _(""This value must contain only letters, numbers and underscores."")
}}}
"	defect	closed	Validators	0.91	critical	fixed	utf-8		Unreviewed	0	0	0	0	0	0
