fix wrong encoding detection logic
This commit is contained in:
parent
f0aed18233
commit
137590e819
1 changed files with 5 additions and 4 deletions
|
|
@ -137,8 +137,9 @@ class Page(object):
|
||||||
|
|
||||||
# Last chance to change encoding, according to :meth:`detect_encoding`,
|
# Last chance to change encoding, according to :meth:`detect_encoding`,
|
||||||
# which can be used to detect a document-level encoding declaration
|
# which can be used to detect a document-level encoding declaration
|
||||||
|
if not self.forced_encoding:
|
||||||
encoding = self.detect_encoding()
|
encoding = self.detect_encoding()
|
||||||
if encoding != self.encoding:
|
if encoding and encoding != self.encoding:
|
||||||
self.response.encoding = encoding
|
self.response.encoding = encoding
|
||||||
self.doc = self.build_doc(self.data)
|
self.doc = self.build_doc(self.data)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue