Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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">
  <NamedLayer>
    <Name>MyWorkspace:MyLayer</Name>
    <UserStyle>
      <Name>MyLayer_default_style</Name>
      <Title>MyLayer</Title>
      <Abstract>Default style for Mylayer</Abstract>
      <FeatureTypeStyle>
        <Rule>
          <Title>Polygon</Title>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#CBCCCC</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#CBCCCC</CssParameter>
              <CssParameter name="stroke-width">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

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:NamedLayer>
    <sld:Name>MyWorkspace:MyLayer</sld:Name>
    <sld:UserStyle>
      <sld:Name>MyLayer_default_style</sld:Name>
      <sld:Title>MyLayer</sld:Title>
      <sld:Abstract>Default style for Mylayer</sld:Abstract>
      <sld:FeatureTypeStyle>
        <sld:Name>name</sld:Name>
        <sld:Rule>
          <sld:Title>Polygon</sld:Title>
          <sld:PolygonSymbolizer>
            <sld:Fill>
              <sld:CssParameter name="fill">#CBCCCC</sld:CssParameter>
            </sld:Fill>
            <sld:Stroke>
              <sld:CssParameter name="stroke">#CBCCCC</sld:CssParameter>
            </sld:Stroke>
          </sld:PolygonSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>

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
add comment

1 Answer

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.

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
add comment

Your Answer

 
discard

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.