Compare commits
No commits in common. "325a373e3e738b0d27c8064f4b880290baf79eaf" and "285e1e5f42b4356687dda253c01fc6d9a88dafc7" have entirely different histories.
325a373e3e
...
285e1e5f42
|
@ -149,15 +149,6 @@ class GZIPHandler(BaseHandler):
|
||||||
|
|
||||||
|
|
||||||
def detect_encoding(data, resp=None):
|
def detect_encoding(data, resp=None):
|
||||||
enc = detect_raw_encoding(data, resp)
|
|
||||||
|
|
||||||
if enc == 'gb2312':
|
|
||||||
enc = 'gbk'
|
|
||||||
|
|
||||||
return enc
|
|
||||||
|
|
||||||
|
|
||||||
def detect_raw_encoding(data, resp=None):
|
|
||||||
if resp is not None:
|
if resp is not None:
|
||||||
enc = resp.headers.get('charset')
|
enc = resp.headers.get('charset')
|
||||||
if enc is not None:
|
if enc is not None:
|
||||||
|
|
|
@ -100,7 +100,7 @@ def parse(data, url=None, mimetype=None, encoding=None):
|
||||||
try:
|
try:
|
||||||
feed = parser(data, encoding=encoding)
|
feed = parser(data, encoding=encoding)
|
||||||
|
|
||||||
except (ValueError, SyntaxError):
|
except (ValueError):
|
||||||
# parsing did not work
|
# parsing did not work
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue