Skip to content

Commit

Permalink
[1.5.x] Fixed #6234 -- Removed obsolete note about json and ensure_ascii
Browse files Browse the repository at this point in the history
Thanks aaron at cellmap.ca for the report.
Backport of 4e8d952 from master.
  • Loading branch information
claudep committed Nov 3, 2012
1 parent d7688a0 commit b61778d
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions docs/topics/serialization.txt
Expand Up @@ -166,15 +166,6 @@ Notes for specific serialization formats
json
^^^^

If you're 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 won't be encoded correctly.

For example::

json_serializer = serializers.get_serializer("json")()
json_serializer.serialize(queryset, ensure_ascii=False, stream=response)

Be aware that not all Django output can be passed unmodified to :mod:`json`.
In particular, :ref:`lazy translation objects <lazy-translations>` need a
`special encoder`_ written for them. Something like this will work::
Expand Down

0 comments on commit b61778d

Please sign in to comment.