Closed casperhart closed 3 years ago
Hello,
Are you able to share the file ?
Otherwise I looked at the changes you made in your fork and they look good, so if you want to open PR you can 😃
Hi, unfortunately I can't share the file as the data is somewhat sensitive, but I will open a PR. Thanks
Hello, I have a .dbf file which failed to read using dbase-rs using the following code:
And produced the following error:
I did some investigation and found the issue is that the reader and data were misaligned by one character. I.e. a field that is meant to be read as "value" would instead be read as " valu". This would cause a date field to fail to parse and throw an error.
This appeared to be because the call to
Reader::new
resulted insource
with a cursor at position 1409, when the valueoffset_to_first_record
was 1410 for this particular file. Adding the following code at the end of theReader::new
function inreading.rs
appeared to fix the issue, ensuring that the source cursor position is correct:I don't know why this issue presents itself for my .dbf file and not for others (perhaps it doesn't follow the spec exactly?). However, other DBF readers appear to have no trouble, which is why I've opened the issue.