Opened 19 years ago
Closed 19 years ago
#3008 closed defect (fixed)
[newforms] Newforms don't work with utf8 characters in values or options
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev | 
| Severity: | normal | Keywords: | |
| Cc: | nesh@…, sergey.kirillov@… | Triage Stage: | Unreviewed | 
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Currently I'm using ChoicesField and when I try to render field in the template with {{ form.field }} I got the following traceback:
Traceback (most recent call last): File "/store/django/django/template/__init__.py" in render_node 712. result = node.render(context) File "/store/django/django/template/__init__.py" in render 763. return self.encode_output(output) File "/store/django/django/template/__init__.py" in encode_output 745. return str(output) File "/store/django/django/newforms/forms.py" in __str__ 145. return self.as_widget(self._field.widget) File "/store/django/django/newforms/forms.py" in as_widget 159. return widget.render(self._name, self._form.data.get(self._name, None), attrs=attrs) File "/store/django/django/newforms/widgets.py" in render 85. output.append(u'<option value="%s"%s>%s</option>' % (escape(option_value), selected_html, escape(option_label))) UnicodeDecodeError at /admin/nekretnine/add/rs/ 'ascii' codec can't decode byte 0xc4 in position 2: ordinal not in range(128)
Attachments (1)
Change History (5)
comment:1 by , 19 years ago
comment:3 by , 19 years ago
| Cc: | added | 
|---|
comment:4 by , 19 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
Could you please provide a full test case for reproducing this bug? Best would be a patch against trunk/tests/regressiontests/forms/tests.py