不废话直接上代码:
Map<String, URL> params=new HashMap<String, URL>();
params.put("url", new File(path).toURL());
DataStore datastore=DataStoreFinder.getDataStore(params);
ShapefileDataStore shpDatastor=(ShapefileDataStore)datastore;
shpDatastor.setStringCharset(Charset.forName("GBK"));