Opened 12 years ago

Closed 12 years ago

#3947 closed (duplicate)

Localized labels don't work with newforms

Reported by: anonymous Owned by: Adrian Holovaty
Component: Forms Version: master
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


I have this form.

from django import newforms as forms
from django.utils.translation import gettext_lazy as _

    ('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)

newforms-unicode.diff (1.9 KB) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (2)

Changed 12 years ago by anonymous

Attachment: newforms-unicode.diff added

comment:1 Changed 12 years ago by Malcolm Tredinnick

Resolution: duplicate
Status: newclosed

This is the same underlying problem as #3924. I'm working on it now.

Note: See TracTickets for help on using tickets.
Back to Top