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

Skip to content

Commit ae74810

Browse files
committed
Patch for an Issue reported via email
1 parent 89e0fc8 commit ae74810

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/request/basic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ def checkCharEncoding(encoding, warn=True):
156156
if delimiter in encoding:
157157
encoding = encoding[:encoding.find(delimiter)].strip()
158158

159+
encoding = encoding.replace("&quot", "")
160+
159161
# popular typos/errors
160162
if "8858" in encoding:
161163
encoding = encoding.replace("8858", "8859") # iso-8858 -> iso-8859
@@ -189,6 +191,8 @@ def checkCharEncoding(encoding, warn=True):
189191
encoding = "ascii"
190192
elif encoding.find("utf8") > 0:
191193
encoding = "utf8"
194+
elif encoding.find("utf-8") > 0:
195+
encoding = "utf-8"
192196

193197
# Reference: http://philip.html5.org/data/charsets-2.html
194198
if encoding in translate:

0 commit comments

Comments
 (0)