I am trying to read Microsoft Access [.mdb] file (created by ChemFinder on Windows), but I am getting
UnicodeDecodeError: 'utf-8' codec... error despite specifying encoding as recovered by meza.io.get_encoding()
to be TIS-620
I would appreciate any suggestions...
Details below:
import meza
fn = 'test.mdb'
encoding = meza.io.get_encoding(fn)
print(enc) # TIS-620
records = meza.io.read_mdb(fn, encoding=enc)
z = list(records)
~/anaconda3/lib/python3.8/site-packages/meza/io.py in read_mdb(filepath, table, **kwargs)
636 # https://stackoverflow.com/a/17698359/408556
637 with Popen(['mdb-export', filepath, table], **pkwargs).stdout as pipe:
--> 638 first_line = StringIO(str(pipe.readline()))
639 names = next(csv.reader(first_line, **kwargs))
640 uscored = ft.underscorify(names) if sanitize else names
~/anaconda3/lib/python3.8/codecs.py in decode(self, input, final)
320 # decode input (taking the buffer into account)
321 data = self.buffer + input
--> 322 (result, consumed) = self._buffer_decode(data, self.errors, final)
323 # keep undecoded input until the next call
324 self.buffer = data[consumed:]
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 70: invalid start byte
I tried to pass encoding to pkwargs used in Popen (in meza/io.py)
I am trying to read Microsoft Access [.mdb] file (created by ChemFinder on Windows), but I am getting
UnicodeDecodeError: 'utf-8' codec...
error despite specifying encoding as recovered by meza.io.get_encoding() to beTIS-620
I would appreciate any suggestions...
Details below:
I tried to pass encoding to pkwargs used in Popen (in meza/io.py)
but it does not resolve the issue. With this modification I am getting: