diff --git a/django/newforms/fields.py b/django/newforms/fields.py index 1391bd1b2f..0f082b9ee3 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -51,7 +51,7 @@ class Field(object): if label is not None: label = smart_unicode(label) self.required, self.label, self.initial = required, label, initial - self.help_text = help_text + self.help_text = smart_unicode(help_text or '') widget = widget or self.widget if isinstance(widget, type): widget = widget() diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index c53729da46..2e34111b3e 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -2698,6 +2698,13 @@ purposes, though.
  • Username: e.g., user@example.com
  • Password:
  • +Help text can include arbitrary Unicode characters. +>>> class UserRegistration(Form): +... username = CharField(max_length=10, help_text='ŠĐĆŽćžšđ') +>>> p = UserRegistration(auto_id=False) +>>> p.as_ul() +u'
  • Username: \u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111
  • ' + # Subclassing forms ########################################################### You can subclass a Form to add fields. The resulting form subclass will have