Ticket #10190: http_response_charset.diff
File http_response_charset.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/http/__init__.py
269 269 status_code = 200 270 270 271 271 def __init__(self, content='', mimetype=None, status=None, 272 content_type=None ):272 content_type=None, charset=None): 273 273 from django.conf import settings 274 self._charset = settings.DEFAULT_CHARSET275 if mimetype:276 content_type = mimetype # For backwards compatibility274 self._charset = charset 275 if not self._charset: 276 self._charset = settings.DEFAULT_CHARSET 277 277 if not content_type: 278 content_type = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE, 279 settings.DEFAULT_CHARSET) 278 if not mimetype: 279 mimetype = settings.DEFAULT_CONTENT_TYPE # Maybe we should call it settings.DEFAULT_MIMETYPE? 280 content_type = "%s; charset=%s" % (mimetype, 281 self._charset) 280 282 if not isinstance(content, basestring) and hasattr(content, '__iter__'): 281 283 self._container = content 282 284 self._is_string = False