I am using the GeoServer REST Configuration to add the following SLD file to GeoServer:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld">
      <Abstract>Default style for Mylayer</Abstract>
              <CssParameter name="fill">#CBCCCC</CssParameter>
              <CssParameter name="stroke">#CBCCCC</CssParameter>
              <CssParameter name="stroke-width">1</CssParameter>

I have used the example from the GeoServer REST Docs and the sld file is added to GeoServer like expected. But the encoding of the sld file in GeoServer is now "UTF-8" instead of "ISO-8859-1" which I declared. See the SLD created by GeoServer below:

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
      <sld:Abstract>Default style for Mylayer</sld:Abstract>
              <sld:CssParameter name="fill">#CBCCCC</sld:CssParameter>
              <sld:CssParameter name="stroke">#CBCCCC</sld:CssParameter>

I have tested this using GeoServer 2.1 (all RC and final release).

How can I add the SLD by using the GeoServer REST Configuration with my declared encoding and not "UTF-8"?

1 Answer 1


Looks like you stumbled across a bug. Your next best course of action to file a geoserver bug report with the all the information provided here to reproduce the problem.

This bug has been resolved and the solution is now to use the raw parameter in the REST request.

  • Thanks for the answer, I will file it as a bug on GeoServer Bug Tracker.
    – taudorf
    May 16, 2011 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.