jdbf icon indicating copy to clipboard operation
jdbf copied to clipboard

Character length

Open deanon opened this issue 7 years ago • 1 comments

Hi, there is an issue with Character field's length (byte 17 should be considered as hi part of length word for character, see http://www.autopark.ru/ASBProgrammerGuide/DBFSTRUC.HTM ), and here is how I've fixed it:

 switch (type) {
            case Character:
                length = (fieldBytes[17] << 8) | (fieldBytes[16] & 0xff);
                break;
            default:

                length = fieldBytes[16];
                if (length <= 0)
                    length = 256 + length;
        }

deanon avatar Jul 25 '18 07:07 deanon

@deanon can you please make PR and also, add a test for it?

iryndin avatar Jul 26 '18 05:07 iryndin