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

Error encoding #20

Open
sin-raben opened this issue Jul 15, 2016 · 0 comments
Open

Error encoding #20

sin-raben opened this issue Jul 15, 2016 · 0 comments

Comments

@sin-raben
Copy link

sin-raben commented Jul 15, 2016

In the module "node-dbf" there is the following problem:
the encoding with large files,

buffer = overflow + buffer //return string utf-8

replace

buffer = Buffer.concat([overflow,buffer], buffer.length + overflow.length); //return buffer

fields, records "N" may be not integer ("N 15 3"),
when processing fields of type "F" is equal to 0 it returns NaN.

value = +value; //for field.type 'F','N' (standard no leading zeros)

I would also like to ask to add the ability to specify the decoding function of string

value = (buffer.toString @encoding).trim()

replace

if (this.encodingFunction) {
    value = (this.encodingFunction(buffer)).trim();
} else {
    value = (buffer.toString(this.encoding)).trim();
}

and add type the date

if (field.type === 'D') {
    value = new Date(+value.slice(0,4), +value.slice(4,6), +value.slice(6,8));
}
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

1 participant