summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-22 13:26:07 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-22 13:26:07 +0000
commitd8b84cac9170d26b8a7033c2c7ff7a6620ac81b6 (patch)
treed56e46bceedd46bd84f9557d987ff7104923b851 /docs
parent96bc9ec79d12420a765ba210a9d8313c05b13d39 (diff)
Fixed #2515 -- Allow passing of options to JSON serializer. Thanks, nesh.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3795 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/serialization.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/serialization.txt b/docs/serialization.txt
index 25199e7a50..694e2d25db 100644
--- a/docs/serialization.txt
+++ b/docs/serialization.txt
@@ -96,6 +96,21 @@ Django "ships" with a few included serializers:
.. _json: http://json.org/
.. _simplejson: http://undefined.org/python/#simplejson
+Notes For Specific Serialization Formats
+----------------------------------------
+
+json
+~~~~
+
+If you are using UTF-8 (or any other non-ASCII encoding) data with the JSON
+serializer, you must pass ``ensure_ascii=False`` as a parameter to the
+``serialize()`` call. Otherwise the output will not be encoded correctly.
+
+For example::
+
+ json_serializer = serializers.get_serializer("json")
+ json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
+
Writing custom serializers
``````````````````````````