'encoding of Response.content.
if Response.encoding is None, encoding will be guessed
by header or content or chardet if available.'

@property
def encoding(self):

    if hasattr(self, '_encoding'):
        return self._encoding
    if isinstance(self.content, six.text_type):
        return 'unicode'
    encoding = get_encoding(self.headers, self.content)
    if ((not encoding) and (chardet is not None)):
        encoding = chardet.detect(self.content[:600])['encoding']
    if (encoding and (encoding.lower() == 'gb2312')):
        encoding = 'gb18030'
    self._encoding = (encoding or 'utf-8')
    return self._encoding
