Git Product home page Git Product logo

Comments (6)

tmcw avatar tmcw commented on July 30, 2024

Hm, I'm not sure - 10 is, yes, what it's supposed to be, but it's odd that this wouldn't cause other behavior than just shorter fields.

from dbf.

alexladerman avatar alexladerman commented on July 30, 2024

The file i am trying to generate.... which is used in an old clipper based
accounting program uses 10 character headers.
On Jul 10, 2014 4:36 PM, "Tom MacWright" [email protected] wrote:

Hm, I'm not sure - 10 is, yes, what it's supposed to be, but it's odd that this
wouldn't cause other behavior
https://github.com/mapbox/dbf/blob/master/src/structure.js#L48-L50 than
just shorter fields.


Reply to this email directly or view it on GitHub
#11 (comment).

from dbf.

bakednevada avatar bakednevada commented on July 30, 2024

@tmcw the reason it doesn't change behavior is twofold: ArrayBuffers are zero-filled by default and the other operations use the correct offsets, so it's leaving null characters in the trailing bytes of the name. Increasing the number of characters should not have any adverse effects.

from dbf.

coding-spider avatar coding-spider commented on July 30, 2024

Same issue. Any update?

from dbf.

northtron avatar northtron commented on July 30, 2024

Hello,
You can override the 8 character limit by changing the f.name.splice(0.8) to (0,10):

field_meta.forEach(function(f, i) { // field name f.name.split('').slice(0, 8).forEach(function(c, x) { view.setInt8(32 + i * 32 + x, c.charCodeAt(0)); }); // field type view.setInt8(32 + i * 32 + 11, f.type.charCodeAt(0)); // field length view.setInt8(32 + i * 32 + 16, f.size); if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3); });

to

field_meta.forEach(function(f, i) { // field name f.name.split('').slice(0, 10).forEach(function(c, x) { view.setInt8(32 + i * 32 + x, c.charCodeAt(0)); }); // field type view.setInt8(32 + i * 32 + 11, f.type.charCodeAt(0)); // field length view.setInt8(32 + i * 32 + 16, f.size); if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3); });

from dbf.

sheindel avatar sheindel commented on July 30, 2024

Happy to report this is finally merged in (#33)! Hopefully we can publish an updated npm package soon

from dbf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.