Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将美国人口普查制图边界文件(可在此处获取:http ://www.census.gov/geo/www/cob/bdy_files.html )导入 GeoDjango 应用程序。但是,python 抱怨 UnicodeDecodeErrors(例如,对于波多黎各的非 ascii 字符)。
shapefile 描述文件 (*.dbf) 没有指定它使用的字符编码;这不是由 shapefile 规范定义的。要使用的正确字符编码是什么?
我对 2010 年人口普查全几何形状的 CBSA 和 Place 数据有同样的问题。这些不是剪辑的carto 文件。
IBM850 对我来说不能正常工作。一时兴起,我尝试了 latin1 并且效果很好。
美国人口普查制图边界文件使用IBM850字符编码。正确编码这些字符串的 Python 代码如下:
IBM850
unicode(featurestring.decode("IBM850"))