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

Skip to content

Commit 48a67d6

Browse files
committed
fix for "unknown charset 'windows-874'" reported by Phat R.
1 parent 82bce81 commit 48a67d6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/request/basic.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,19 @@ def parseResponse(page, headers):
9191
kb.absFilePaths.add(absFilePath)
9292

9393
def checkCharEncoding(encoding):
94+
if encoding:
95+
encoding = encoding.lower()
96+
else:
97+
return encoding
98+
99+
#http://www.destructor.de/charsets/index.htm
100+
translate = { 'windows-874':'iso-8859-11' }
101+
94102
#http://philip.html5.org/data/charsets-2.html
95103
if encoding and encoding.startswith('cp-'):
96104
encoding = 'cp%s' % encoding[3:]
105+
elif encoding in translate:
106+
encoding = translate[encoding]
97107
try:
98108
codecs.lookup(encoding)
99109
except LookupError:

0 commit comments

Comments
 (0)