---
title: "GeoServer发布shapfile字段名和值乱码问题解决"
author: "wiselyman"
date: "2012-10-08T09:29:04Z"
tags: []
categories: ["开源软件"]
slug: "geoserver-shapfile"
draft: false
lastmod: "2012-10-08T09:29:04Z"
id: 1692688
url: "https://wiselyman.iteye.com/blog/1692688"
---

网上说了一大堆方法又是转格式咯又是改源代码了，修改很简单：

修改Styles下的你的style：

```
<?xml version="1.0" encoding="GBK"?>
<StyledLayerDescriptor version="1.0.0" 
 xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
 xmlns="http://www.opengis.net/sld" 
 xmlns:ogc="http://www.opengis.net/ogc" 
 xmlns:xlink="http://www.w3.org/1999/xlink" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
```

 修改Stores下你的图层的属性，设置 DBF charset为GBK

以上设置GBK和GB2312均可，UTF-8不行