mapbox / dbf

dbf writer
BSD 2-Clause "Simplified" License
37 stars 56 forks source link

Attribute names and value are now written in UTF-8 if TextEncoder exists #26

Open jeff-tenhave opened 7 years ago

jeff-tenhave commented 7 years ago

Although dbf does not officially support UTF-8, it is supported by Shapefile. Right now non-ASCII characters end up getting written to the dbf as garbage values. So instead we just write them in UTF-8, if TextEncoder is found. If not, then we revert to the previous behavior. I also increased the field name length to 11 bytes (it was 8 bytes), as that is what is supported in dbf. Note: I think this PR is trying to accomplish the same thing as this one, except that it uses node Buffer. @danswick