Opened 17 years ago
Closed 17 years ago
#7122 closed (invalid)
Unicode problem in ChoiceField
Reported by: | Mihai Damian | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have a ChoiceField defined like this:
country = forms.ChoiceField(choices,required=False,label=_('Country'))
,where country is a list of tuples of the form (countrycode, countryname).
countrycode is always ASCII but some countrynames are UNICODE. If the tuples contain no UNICODE strings, all works fine. If I add to that just one tuple with UNICODE the whole form doesn't get rendered anymore (I use form.as_table to render the whole table for now). No errors are displayed, it just fails to render the form.
I saw there was a previous ticket with ChoiceFields not working with UNICODE but from what I understood the issue was supposed to be solved a long time ago
OK, it seems there was an encoding problem in one of my files. Works fine