Ticket #10190: charset_without_mimetype.diff

File charset_without_mimetype.diff, 1.0 KB (added by ccahoon, 15 years ago)

with changes suggested by mtreddinick (first draft)

  • django/http/__init__.py

     
    272272    status_code = 200
    273273
    274274    def __init__(self, content='', mimetype=None, status=None,
    275             content_type=None):
     275            content_type=None, charset=None):
    276276        from django.conf import settings
    277         self._charset = settings.DEFAULT_CHARSET
     277        self._charset = charset
     278        if not self._charset:
     279            self._charset = settings.DEFAULT_CHARSET
    278280        if mimetype:
    279281            content_type = mimetype     # For backwards compatibility
    280282        if not content_type:
    281             content_type = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE,
    282                     settings.DEFAULT_CHARSET)
     283            content_type = "%s" % settings.DEFAULT_CONTENT_TYPE
    283284        if not isinstance(content, basestring) and hasattr(content, '__iter__'):
    284285            self._container = content
    285286            self._is_string = False
Back to Top