﻿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
12645	UnicodeEncodeError when validating forms with non-ascii field names	Alan Justino da Silva	unbracketed	"I am creating forms dynamically, so users can type field names.

Django is raising UnicodeEncodeError when some field name has a non-ascii name. Is simple not acceptable to constrain users to ASCII only.

Baked example:
{{{
class UtilizacaoForm(forms.Form):
    pass

ut = UtilizacaoForm()
ut.fields[u'Diâmetro'] = forms.CharField(max_length=3)

ut.is_valid()
File ""django/forms/forms.py"" in is_valid
  120.         return self.is_bound and not bool(self.errors)
File ""django/forms/forms.py"" in _get_errors
  111.             self.full_clean()
File ""django/forms/forms.py"" in full_clean
  242.                 if hasattr(self, 'clean_%s' % name):

Exception Type: UnicodeEncodeError at /novakoski/modelos/detalhe/1/
Exception Value: ('ascii', u'clean_Di\xe2metro', 8, 9, 'ordinal not in range(128)')
}}}

Occurs because hasattr(obj, str) can't handle non-ascii at str, before preparing to call clean_fieldname.

Bug found at 1.1.1 (r11612), but stays alive at actual TRUNK (r12264).

Original traceback paste: http://dpaste.com/hold/147583/

Quick fix added."		closed	Forms	1.1		wontfix	unicode	alan.justino@…	Accepted	1	0	0	1	0	0
