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
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