Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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="" xmlns:xlink="" xmlns:xsi="" xsi:schemaLocation="" xmlns="">
      <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="" xmlns:sld="" xmlns:ogc="" xmlns: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"?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
Thanks for the answer, I will file it as a bug on GeoServer Bug Tracker. – taudorf May 16 '11 at 7:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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