aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/utils')
-rw-r--r--rest_framework/utils/mediatypes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/utils/mediatypes.py b/rest_framework/utils/mediatypes.py
index 3fc59edd..aea1b629 100644
--- a/rest_framework/utils/mediatypes.py
+++ b/rest_framework/utils/mediatypes.py
@@ -5,6 +5,7 @@ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
"""
from django.http.multipartparser import parse_header
+from rest_framework import HTTP_HEADER_ENCODING
def media_type_matches(lhs, rhs):
@@ -47,7 +48,7 @@ class _MediaType(object):
if media_type_str is None:
media_type_str = ''
self.orig = media_type_str
- self.full_type, self.params = parse_header(media_type_str.encode('iso-8859-1'))
+ self.full_type, self.params = parse_header(media_type_str.encode(HTTP_HEADER_ENCODING))
self.main_type, sep, self.sub_type = self.full_type.partition('/')
def match(self, other):