Skip to content

Commit 24865a7

Browse files
committed
replace chardet to charset_normalizer
1 parent 57807fc commit 24865a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fulltext/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ def check(self, title):
373373

374374
def decode(self, s):
375375
"""Decode string."""
376-
import chardet
376+
from charset_normalizer import detect
377377
r = ""
378378
try: r = s.decode(self.encoding, self.encoding_errors)
379-
except UnicodeDecodeError: r = s.decode(chardet.detect(s)["encoding"], self.encoding_errors)
379+
except UnicodeDecodeError: r = s.decode(detect(s)["encoding"], self.encoding_errors)
380380
return r
381381

382382
def handle_title(self, path_or_file):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
NAME = 'fulltext'
12-
VERSION = '0.10'
12+
VERSION = '0.11'
1313
if os.name == 'nt' and not sys.maxsize > 2 ** 32:
1414
# https://github.com/btimby/fulltext/issues/79
1515
raise RuntimeError("Python 32 bit is not supported")

0 commit comments

Comments
 (0)