Unhelpful handling of UTF_8 encoding bugs in ModelForm field.help_text
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)
Summary: |
Unhelpfull handling of UTF_8 encoding bugs in ModelForm field.help_text → Unhelpful handling of UTF_8 encoding bugs in ModelForm field.help_text
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to kgrandis
|
Status: |
new → assigned
|
Owner: |
kgrandis removed
|
Status: |
assigned → new
|
Resolution: |
→ wontfix
|
Status: |
new → closed
|
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.