我的github

在读取shp文件之前,先要手动调用一下ShapefileDataStore的setStringCharset方法即可 dataStore.setStringCharset(Charset.forName("UTF-8"));

可能是原始的shp文件的dbf属性字符串是用utf-8保存的缘故?

参考:https://www.osgeo.cn/post/6067g

store.setCharset(Charset.forName("GBK"));//store.setCharset(Charset.forName("UTF-8"));

 

posted on 2023-02-02 17:18  XiaoNiuFeiTian  阅读(237)  评论(0编辑  收藏  举报