Opened 18 years ago
Closed 17 years ago
#2946 closed enhancement (invalid)
HttpResponse should set charset for mimetypes starting with 'text/'
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I came across this point during doing some Ajax related responses with return mostly text/xml in utf-8. If I create HttpResponse(data, mimetype='text/xml') the default charset won't be set by django. Instead I have to call it HttpResponse(data, mimetype='text/xml; charset=\'utf-8\) which is not the right way in my opinion.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | django-http-mimetype.diff added |
---|
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Automatically setting the charset is dangerous since Django shouldn't be guessing about what you're trying to review. If you're returning text/*, you do need to think about charsets and handle them yourself.
make charset set for mimetypes starting with 'text/'