yortus/DBFFile

Missing the first character of value

schalkt opened this issue · 2 comments

Hi,
I'm really surprised that I found a dbf reader under nodejs. :) Thanks!
But when I tested I got wrong results some fields.
The first character missed. The DBF encoding is CP-852.
(I did not test to create or modify the records, because I need to read from old dbs only.)

{ NEV: 'FD', TARTALOM: 'iák munkaváll. 110120' } - the wrong result
{ NEV: 'F', TARTALOM: 'Diák munkaváll. 110120' } - i think it should be like this

Maybe the tabs or extra spaces in the field value cause the problem?
The console log results

Képernyőkép 2022-05-31 152034

Hi @schalkt! Yes, that seems strange, I haven't seen that problem before. Encodings are handled by the iconv-lite library which says CP-852 is supported. You may be right that it is something special with how the fields are laid out in the file. There are so many versions and variations, that I can't say what the issue could be without access to a dbf file that has the issue. Would that be possible? Otherwise, if you are able to dig in and find the cause yourself, I'd be happy to take a PR.

It contains mainly personal data and sharing is not possible due to GDPR.
But, it seems I will get exports from the original DOS program, so currently I'm waiting.
Thank you for your answer! :)