Closed SpatialDigger closed 3 years ago
Yes, that probably means your file isn't endoded in utf8, most likely in latin encoding instead, unless you're dealing with some non-english language. You can set the expected file encoding when creating the reader:
sf = shapefile.Reader(path, encoding='latin')
records = sf.records()
Alternatively, if that doesn't work you can bypass and ignore encoding errors, eg through encodingErrors='ignore'
.
The following does not read the records.
returns
Single record works
sf.record(3)
utf-8 issue?