From 58a90404445ca2a2c66f1bec5cddd9b8c9f81707 Mon Sep 17 00:00:00 2001 From: Steve Romanow Date: Wed, 18 May 2011 18:16:48 -0400 Subject: [PATCH] respect request charset --- flask/wrappers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flask/wrappers.py b/flask/wrappers.py index 4db1e782..557ab841 100644 --- a/flask/wrappers.py +++ b/flask/wrappers.py @@ -73,7 +73,13 @@ class Request(RequestBase): if __debug__: _assert_have_json() if self.mimetype == 'application/json': - return json.loads(self.data) + request_charset = self.mimetype_params.get('charset') + if request_charset is not None: + j = json.loads(self.data, encoding=request_charset ) + else: + j = json.loads(self.data) + + return j class Response(ResponseBase):