From 8d9982c5a572358f0f3fc3402766ce9e3a06d90c Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 11 Jul 2007 06:55:12 +0000 Subject: [PATCH] Fixed #4815 -- Fixed decoding of request parameters when the input encoding is not UTF-8. Thanks, Jordan Dimov. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5644 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/http/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/django/http/__init__.py b/django/http/__init__.py index 7061644a4e..bcb06cbb87 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -109,12 +109,11 @@ class QueryDict(MultiValueDict): # *Important*: do not import settings any earlier because of note # in core.handlers.modpython. from django.conf import settings - self.encoding = settings.DEFAULT_CHARSET - else: - self.encoding = encoding + encoding = settings.DEFAULT_CHARSET + self.encoding = encoding self._mutable = True for key, value in parse_qsl((query_string or ''), True): # keep_blank_values=True - self.appendlist(force_unicode(key, errors='replace'), force_unicode(value, errors='replace')) + self.appendlist(force_unicode(key, encoding, errors='replace'), force_unicode(value, encoding, errors='replace')) self._mutable = mutable def _assert_mutable(self):