Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0990f16

Browse files
committed
minor update for invalid cases like 'iso-8859-1 (western europe)'
1 parent 2da56ea commit 0990f16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/request/basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def checkCharEncoding(encoding):
9999
# http://www.destructor.de/charsets/index.htm
100100
translate = { 'windows-874': 'iso-8859-11', 'en_us': 'utf8', 'macintosh': 'iso-8859-1', 'euc_tw': 'big5_tw' }
101101

102-
for delimiter in (';', ','):
102+
for delimiter in (';', ',', '('):
103103
if delimiter in encoding:
104-
encoding = encoding[:encoding.find(delimiter)]
104+
encoding = encoding[:encoding.find(delimiter)].strip()
105105

106106
# popular typos/errors
107107
if '8858' in encoding:

0 commit comments

Comments
 (0)