def contentEncoding(requestHeaders, encoding=None):
if encoding is None:<EOL><INDENT>encoding = b'<STR_LIT:utf-8>'<EOL><DEDENT>headers = _splitHeaders(<EOL>requestHeaders.getRawHeaders(b'<STR_LIT:Content-Type>', []))<EOL>if headers:<EOL><INDENT>return headers[<NUM_LIT:0>][<NUM_LIT:1>].get(b'<STR_LIT>', encoding)<EOL><DEDENT>return encoding<EOL>
Extract an encoding from a ``Content-Type`` header.

@type  requestHeaders: `twisted.web.http_headers.Headers`
@param requestHeaders: Request headers.

@type  encoding: `bytes`
@param encoding: Default encoding to assume if the ``Content-Type``
    header is lacking one. Defaults to ``UTF-8``.

@rtype: `bytes`
@return: Content encoding.