Hello,
I'm trying to send som UTF-8 data this way:
json = serializers.serialize("json", myQuerySet, ensure_ascii=False)
return HttpResponse(json, mimetype="text/javascript; charset=UTF-8")
But the accented characters are not displayed properly in the browser.
But if I put this on the first line of my views.py:
# -*- coding: UTF-8 -*-
and I try to send hard coded data this way:
json = '[{"pk": "1", "model": "body.datacontent", "fields":
{"content": "Heading à 1", "type": "hdg"}},{"pk": "2", "model":
"body.datacontent", "fields": {"content": "Para 1", "type": "par"}}]'
Then "Heading à 1" is properly displayed in the browser.
Question: am I using serializers.serialize the right way or is it
broken ?
Note: my database is UTF-8 encoded too (I have tested that by
extracting an accented string from it and displaying it in the
browser).
Olive
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---