Pau*_*ado 4 python unicode shapefile
我正在尝试读取 shapefile
r = shapefile.Reader(filepath, encoding = "utf-8")
Run Code Online (Sandbox Code Playgroud)
但是当我尝试从.records()对象获取值时,例如:
r.records()[0]
Run Code Online (Sandbox Code Playgroud)
它返回给我以下错误:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 4: invalid continuation byte
Run Code Online (Sandbox Code Playgroud)
这意味着您的文件不是以 utf-8 编码的。尝试:ISO8859-1
如果您在 Linux 上(或在 Windows 上有 git-bash),您可以使用该file命令来找出编码。
| 归档时间: |
|
| 查看次数: |
1524 次 |
| 最近记录: |