mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Fixed UnicodeEncodeError when POST request's parameters include an Unicode character
After getting lots of "'latin-1' codec can't encode characters in position 62-66: ordinal not in range(256)" when POSTing valid Unicode characters with "multipart/form-data" requests I figured out that the issue is that '_perform_form_overloading()' is trying to encode the form data as with 'iso-8859-1' which fails.
This commit is contained in:
parent
452eb81f5c
commit
3d35b2939c
|
@ -334,7 +334,7 @@ class Request(object):
|
||||||
self._CONTENT_PARAM in self._data and
|
self._CONTENT_PARAM in self._data and
|
||||||
self._CONTENTTYPE_PARAM in self._data):
|
self._CONTENTTYPE_PARAM in self._data):
|
||||||
self._content_type = self._data[self._CONTENTTYPE_PARAM]
|
self._content_type = self._data[self._CONTENTTYPE_PARAM]
|
||||||
self._stream = BytesIO(self._data[self._CONTENT_PARAM].encode(HTTP_HEADER_ENCODING))
|
self._stream = BytesIO(self._data[self._CONTENT_PARAM].encode('utf-8'))
|
||||||
self._data, self._files = (Empty, Empty)
|
self._data, self._files = (Empty, Empty)
|
||||||
|
|
||||||
def _parse(self):
|
def _parse(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user