diff --git a/goodtables/datatable/datatable.py b/goodtables/datatable/datatable.py index 9834988581..40d9027515 100644 --- a/goodtables/datatable/datatable.py +++ b/goodtables/datatable/datatable.py @@ -8,7 +8,7 @@ import io import codecs import datetime -import chardet +import cchardet as chardet import xlrd import csv from bs4 import BeautifulSoup @@ -248,7 +248,7 @@ def _detect_stream_encoding(self, stream): sample = stream.read(sample_length) stream.seek(0) - encoding = chardet.detect(sample)['encoding'] + encoding = chardet.detect(sample)['encoding'].lower() # default to utf-8 for safety if encoding == 'ascii': encoding = 'utf-8' diff --git a/requirements/base.txt b/requirements/base.txt index 0c63096994..59b8eb9b36 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,7 +1,7 @@ click==3.3 requests==2.5.1 jsonschema==2.4.0 -chardet==2.3.0 +cchardet>=1.0.0 xlrd>=0.9.3 tellme>=0.2.4 jsontableschema>=0.5.1