mirror of https://github.com/Mikaela/Limnoria.git
utils/web.py: Properly import chardet.
This commit is contained in:
parent
8095f34250
commit
a82ad9cb1a
|
@ -190,7 +190,7 @@ def htmlToText(s, tagReplace=' '):
|
||||||
"""Turns HTML into text. tagReplace is a string to replace HTML tags with.
|
"""Turns HTML into text. tagReplace is a string to replace HTML tags with.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
import chardet
|
import chardet.universaldetector
|
||||||
except ImportError:
|
except ImportError:
|
||||||
s = s.decode('utf8')
|
s = s.decode('utf8')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue