'Determine the encoding as specified by the browser via the
Content-Type\'s charset parameter, if one is set'

def determine_browser_charset(self):

    charset_match = _CHARSET_RE.search(self.headers.get('Content-Type', ''))
    if charset_match:
        return charset_match.group(1)
