I am learning to use GeoServer. I published a layer from a shp, which I created by importing a csv file into QGIS in utf-8 encoding, and exporting as shp in utf-8 encoding. I added a style to the layer. I got the style from geoserver cookbook for point with default label. The only thing I changed is the contents in <ogc:PropertyName>
, as I have to set it to the name of the column I want to show. I changed it into school_name
. But then the layer doesn't show in layer preview.
Things I've tried:
- change
<ogc:PropertyName>
content to the columnlat
. This column contains latitude. The type shown on GeoServer is double. This works. - change
<ogc:PropertyName>
content toschool
. This column contains Chinese characters. The type shown on GeoServer is string. The layer shows but the labels are ??. - change
<ogc:PropertyName>
content toschool
and change the xml encoding to utf-8 and UTF-8. Again, the layer shows, but the labels are ?? - change
<ogc:PropertyName>
content toschool
and addformat_options=CHARSET:UTF-8
in the WMS request. Again, the layer shows, but the labels are ??. - change content to
postal_code
. This column contains postcodes which are just numbers. The type shown on GeoServer is long. The layer doesn't show.
So how do I show Chinese labels? And how do I fix the problem where column names with underscore doesn't show?
postal_code
topostal_cod
, it works, and if I changeschool_name
toschool_nam
, the layer shows, although the characters are still square because the data are Chinese characters.