diff --git a/scrapy/http/response/html.py b/scrapy/http/response/html.py index f4236f426..60ca40edf 100644 --- a/scrapy/http/response/html.py +++ b/scrapy/http/response/html.py @@ -18,7 +18,7 @@ class HtmlResponse(TextResponse): _content_re = _template % ('content', r'(?P[^;]+);\s*charset=(?P[\w-]+)') _content2_re = _template % ('charset', r'(?P[\w-]+)') - METATAG_RE = re.compile(r'Some page Price: \xa3100' """ @@ -257,6 +256,16 @@ class HtmlResponseTest(TextResponseTest): r1 = self.response_class("http://www.example.com", body=body) self._assert_response_values(r1, 'gb2312', body) + def test_httpequiv_meta(self): + body = '''''' + response = self.response_class('http://example.com', body=body) + self._assert_response_values(response, 'gb18030', body) + + body = '''''' + response = self.response_class('http://example.com', body=body) + self._assert_response_values(response, 'gb18030', body) + + class XmlResponseTest(TextResponseTest):