On Sat, Jan 9, 2010 at 11:26 AM, Benjamin W. <b_w...@gmx.net> wrote:

> how can I change the charset of an HttpRespone?
> I tried something like this:
>
>    response = HttpResponse(mimetype='text/csv')
>    response['Content-Disposition'] = 'attachment; filename=test.csv'
>    response['charset'] = 'ISO-8859-1'
>
> But this doesn't work - I still get an UTF-8 encoded file.
>
>
You can change the charset for all responses by changing
settings.DEFAULT_CHARSET.

Changing the charset for just certain responses is not at present so easy
(though it can be done), see: http://code.djangoproject.com/ticket/10190.
Note if you do it manually now based on how the current code is written it
may stop working when that ticket gets fixed in trunk, depending on
specifics of the fix (which I have not looked at).

Karen
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply via email to