We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0c2f29e + 75e2e0c commit 2d4cfdbCopy full SHA for 2d4cfdb
readability/encoding.py
@@ -26,7 +26,7 @@ def get_encoding(page):
26
if not text.strip() or len(text) < 10:
27
return enc # can't guess
28
res = chardet.detect(text)
29
- enc = res['encoding']
+ enc = res['encoding'] or 'utf-8'
30
#print '->', enc, "%.2f" % res['confidence']
31
enc = custom_decode(enc)
32
return enc
@@ -45,4 +45,4 @@ def custom_decode(encoding):
45
if encoding in alternates:
46
return alternates[encoding]
47
else:
48
- return encoding
+ return encoding
0 commit comments