Opened 19 years ago
Closed 19 years ago
#3947 closed (duplicate)
Localized labels don't work with newforms
| Reported by: | anonymous | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | newforms, unicode | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I have this form.
from django import newforms as forms
from django.utils.translation import gettext_lazy as _
LANGUAGES = (
('cs', _('Czech')),
('en', _('English')),
)
class ChangeProfileForm(forms.Form):
language = forms.ChoiceField(label=_('Language'), choices=LANGUAGES)
email = forms.EmailField(label=_('Email'))
phone = forms.CharField(label=_('Phone'))
If localized labels are in UTF-8 and I don't use attached patch, forms don't work (UnicodeDecodeError).
Attachments (1)
Change History (2)
by , 19 years ago
| Attachment: | newforms-unicode.diff added |
|---|
comment:1 by , 19 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This is the same underlying problem as #3924. I'm working on it now.