diff --git a/src/ext/uchardet b/src/ext/uchardet index 795e982..a2d24a5 160000 --- a/src/ext/uchardet +++ b/src/ext/uchardet @@ -1 +1 @@ -Subproject commit 795e982965404568e3a8354e69b08e71137ee6ff +Subproject commit a2d24a50fa23d71f543501168bfe9b3a859c83cd diff --git a/src/tests/test.py b/src/tests/test.py index 88919b7..879fae5 100644 --- a/src/tests/test.py +++ b/src/tests/test.py @@ -102,3 +102,15 @@ class TestCChardet(): except LookupError as e: print("LookupError: { file=%s, encoding=%s }" % (testfile, detected_encoding["encoding"])) raise e + + def test_utf8_with_bom(self): + sample = b'\xEF\xBB\xBF' + detected_encoding = cchardet.detect(sample) + eq_( + "utf-8-sig", + detected_encoding['encoding'].lower(), + 'Expected %s, but got %s' % ( + "utf-8-sig", + detected_encoding['encoding'].lower() + ) + )