+ charset = resp.headers.get('content-type', default='')
+ enc_search = re.search('charset=(?P<enc>\S*)', charset)
+ if enc_search is not None:
+ encoding = enc_search.group('enc')
+ else:
+ encoding = 'utf-8'
+
+ buf = ReadBuffer(resp.raw, self.chunk_size, encoding=encoding)