I am facing a challenge with the encoding in my SLD file in GeoServer on a Ubuntu server. When I create a SLD file containing the danish letters æ, ø, å in the GeoServer web interface like this filter:
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>priority</ogc:PropertyName>
<ogc:Literal>Høj</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
In the "Style Editor" the "ø" looks fine and when submit I can see (in Firebug) that the posted request contains the letter "ø". But when I try to edit the style again, my filter looks like this:
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>priority</ogc:PropertyName>
<ogc:Literal>H?j</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
The "ø" has been replaced with a "?". My SLD header looks like this:
<?xml version="1.0" encoding="UTF-8"?>
I have tried to use Latin-1 encoding
<?xml version="1.0" encoding="ISO-8859-1"?>
But I the "ø" still shows as a "?". When I run "env | grep LANG" in the terminal on the Ubuntu server I get this output:
LANG=en_GB.UTF-8
GDM_LANG=en_GB
LANGUAGE=en_GB:en
This should indicate the default encoding is utf-8. When I run a "file --mime-encoding myld.sld" I get:
us-ascii
My question is:
How do I get GeoServer to write the sld file in utf-8 encoding or in Latin-1 so I can use the danish letters in my SLDs?