tmontaigu / dbase-rs

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

Writing numeric, float, memo and OLE values shorter than field length pads the opposite side #60

Closed martin-kolarik closed 1 year ago

martin-kolarik commented 1 year ago

According to https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm (at the bottom) these values should be right justified and padded with space at the value begin.

Now, the current implementation at https://github.com/tmontaigu/dbase-rs/blob/73a01d15c4278993857fa7195efdffa3c598edd3/src/writing.rs#L400 and at https://github.com/tmontaigu/dbase-rs/blob/73a01d15c4278993857fa7195efdffa3c598edd3/src/writing.rs#L435 first writes the value and then pads with spaces, which is incorrect.