aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/renderers.py
diff options
context:
space:
mode:
authorPablo Recio2013-05-18 16:30:40 +0200
committerPablo Recio2013-05-18 17:06:54 +0200
commitc69f960066dfdef2163a53205f27c2b9e457068f (patch)
tree1b1c67833539ea089e400e6e7fa45258f2deda9a /rest_framework/renderers.py
parent3f47eb7a77fcc735782dd1bf8e8e053e26417ea1 (diff)
downloaddjango-rest-framework-c69f960066dfdef2163a53205f27c2b9e457068f.tar.bz2
Adding a class attribute into JSONRenderer for ensuring ascii, and using it consistently
Diffstat (limited to 'rest_framework/renderers.py')
-rw-r--r--rest_framework/renderers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py
index 8361cd40..d55a3e0e 100644
--- a/rest_framework/renderers.py
+++ b/rest_framework/renderers.py
@@ -49,6 +49,7 @@ class JSONRenderer(BaseRenderer):
media_type = 'application/json'
format = 'json'
encoder_class = encoders.JSONEncoder
+ ensure_ascii = True
def render(self, data, accepted_media_type=None, renderer_context=None):
"""
@@ -72,7 +73,7 @@ class JSONRenderer(BaseRenderer):
except (ValueError, TypeError):
indent = None
- return json.dumps(data, cls=self.encoder_class, indent=indent)
+ return json.dumps(data, cls=self.encoder_class, indent=indent, ensure_ascii=self.ensure_ascii)
class JSONPRenderer(JSONRenderer):