tmontaigu / dbase-rs

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

Trailing whitespaces at the beginning of character records are removed #56

Closed theCapypara closed 1 year ago

theCapypara commented 1 year ago

At the moment the crate removes trailing whitespaces at the beginning of character fields. This is probably fine in most cases, but sometimes there might be a reason for these trailing whitespaces. While trailing whitespaces at the end of a string are padding, those at the beginning are not.

The dbase spec states for character fields:

Symbol Data Type Description
C Character All OEM code page characters - padded with blanks to the width of the field.

(https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm)

tmontaigu commented 1 year ago

This means we probalby need to pass down an option in the Reader to chose whether these leading whitespace should be trimmed or not, or change the behavior without an option 🤔

tmontaigu commented 1 year ago

'Fixed' by #59