diff --git a/buffer/__init__.py b/buffer/__init__.py index d596e99..5189e22 100644 --- a/buffer/__init__.py +++ b/buffer/__init__.py @@ -639,6 +639,7 @@ class FileBuffer(Buffer): data = f.read() f.close() self.store_checksum(data) + data = self.read_filter(data) self.codec = chardet.detect(data)['encoding'].lower() else: data = '' @@ -654,8 +655,6 @@ class FileBuffer(Buffer): if '\t' in data: self.writetabs = True self.nl = self._detect_nl_type(data) - data = self.read_filter(data) - if '\x00' in data[:8192]: raise BinaryDataException("binary files are not supported")