File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333from lib .core .settings import MAX_CONNECTION_TOTAL_SIZE
3434from lib .core .settings import META_CHARSET_REGEX
3535from lib .core .settings import PARSE_HEADERS_LIMIT
36+ from lib .core .settings import UNICODE_ENCODING
3637from lib .core .settings import VIEWSTATE_REGEX
3738from lib .parse .headers import headersParser
3839from lib .parse .html import htmlParser
@@ -197,7 +198,7 @@ def checkCharEncoding(encoding, warn=True):
197198 # Reference: http://www.iana.org/assignments/character-sets
198199 # Reference: http://docs.python.org/library/codecs.html
199200 try :
200- codecs .lookup (encoding )
201+ codecs .lookup (encoding . encode ( UNICODE_ENCODING ) if isinstance ( encoding , unicode ) else encoding )
201202 except LookupError :
202203 if warn :
203204 warnMsg = "unknown web page charset '%s'. " % encoding
You can’t perform that action at this time.
0 commit comments