Opened 16 years ago

Closed 15 years ago

Last modified 12 years ago

#9118 closed (wontfix)

Unhelpful handling of UTF_8 encoding bugs in ModelForm field.help_text

Reported by: Jerzy Ludwichowski Owned by:
Component: Forms Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I am modifying a field of a model in ModelForm and adding a help_text with national characters. The declared encoding is UTF_8, but the actual help_text contains a wrong diacritic (not UTF_8 encoded). The complete form.as_table within my template called does quietly not render -- it just doesn't show. The template displays correctly when the diacritic in error gets removed or corrected.

If I remove the UTF_* coding declaration in the original error situation then the following is reported:

Non-ASCII character '\x9c' in file <forms.py pointer removed> on line 43, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (forms.py, line 43)


Change History (7)

comment:1 by Jerzy Ludwichowski, 16 years ago

Summary: Unhelpfull handling of UTF_8 encoding bugs in ModelForm field.help_textUnhelpful handling of UTF_8 encoding bugs in ModelForm field.help_text

comment:2 by Jacob, 15 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Jacob, 15 years ago

milestone: 1.1

comment:4 by kgrandis, 15 years ago

Owner: changed from nobody to kgrandis
Status: newassigned

comment:5 by kgrandis, 15 years ago

Owner: kgrandis removed
Status: assignednew

comment:6 by Jacob, 15 years ago

Resolution: wontfix
Status: newclosed

I'm not quite sure what Django can do better here; if you've got an invalid encoding in your source file, that's on you.

The reason you're not getting an error in the template is because it's generally the policy that invalid data shouldn't cause the template rendering to break. That's mostly a good policy, and we can't change it even though in this particular case it's causing more harm than good.

comment:7 by Jacob, 12 years ago

milestone: 1.1

Milestone 1.1 deleted

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