Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character length #47

Open
deanon opened this issue Jul 25, 2018 · 1 comment
Open

Character length #47

deanon opened this issue Jul 25, 2018 · 1 comment

Comments

@deanon
Copy link

deanon commented Jul 25, 2018

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;
        }
@iryndin
Copy link
Owner

iryndin commented Jul 26, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants