tmontaigu / dbase-rs

Rust library to read & write dBase files.
MIT License
29 stars 30 forks source link

support ASCIIZ encoding of field names #54

Closed casperhart closed 1 year ago

casperhart commented 1 year ago

I have a dbase file which I would like to read that uses ASCIIZ encoding for the field names (ASCII terminated by "\0" byte). Currently when reading this file, the crate panics with a "Not ASCII" error because the bytes following "\0" are garbage.

This change will read the field name only up to the first "\0" byte, which solves the issue.

These are the docs where I found the detail about the ASCIIZ encoding: https://www.fileformat.info/format/corion-dbase-iii.htm

Let me know if you would suggest any changes.

Cheers