GeospatialPython / pyshp

This library reads and writes ESRI Shapefiles in pure Python.
MIT License
1.1k stars 260 forks source link

UnicodeDecodeError #182

Closed ShawDa closed 5 years ago

ShawDa commented 5 years ago

records = sf.records()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 0: invalid continuation byte

When i use version2, error happens; after change to version1, i can see the record. By the way, it has Chinese character in the records. Hope can fix it!

ShawDa commented 5 years ago

Sorry I did not see here before:https://github.com/GeospatialPython/pyshp#unicode-and-shapefile-encodings change sf = shapefile.Reader('data/2009/2009.shp') to sf = shapefile.Reader('data/2009/2009.shp', encoding='gbk') and problem solved.