Hi list,

I am running GeoServer 2.11.2 (platform independent binary on Windows 10, 64 
bits), and GeoServer does not seem to be able to process an SLD which contains 
Hebrew characters correctly, when created throught the REST API. I created the 
SLD with the following POST request: 

POST http://daneel:8080/geoserver/rest/workspaces/cite/styles.sld HTTP/1.1
Accept: text/xml
User-Agent: Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0
Content-Type: application/vnd.ogc.sld+xml; charset=utf-8
Host: daneel:8080
Cookie: JSESSIONID=fh4cjqmg7n3b3lnwnfpujbnb
Content-Length: 1651
Expect: 100-continue

BODY:
        <StyledLayerDescriptor version="1.0.0" 
xmlns="http://www.opengis.net/sld"; 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";>
  <NamedLayer>
    <Name>roads_hebrew</Name>
    <UserStyle>
      <Name>roads_hebrew</Name>
      <Title>roads hebrew</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>TypeRoad_1</Name>
          <Title>TypeRoad_1</Title>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill-opacity">0</CssParameter>
            </Fill>
          </PolygonSymbolizer>
        </Rule>
        <Rule>
          <Name>דרך אזורית קיימת/מאושרת</Name>
          <Title>דרך אזורית קיימת/מאושרת</Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>TypeRoad_1</ogc:PropertyName>
              <ogc:Literal>
                <![CDATA[דרך אזורית קיימת/מאושרת]]>
              </ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#FF5500</CssParameter>
              <CssParameter name="stroke-width">1.2</CssParameter>
              <CssParameter name="stroke-linecap">round</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Inspecting the SLD we just uploaded through the REST API with the following 
request:

GET http://daneel:8080/geoserver/rest/workspaces/cite/styles/roads_hebrew.sld 
HTTP/1.1
Host: daneel:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 
Firefox/55.0
Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8;charset=utf-8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: JSESSIONID=1d2nnunq6zl6c1kd6ytulxv6nt
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
Connection: keep-alive
Upgrade-Insecure-Requests: 1

RESPONSE BODY:

        <?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor 
xmlns="http://www.opengis.net/sld"; xmlns:sld="http://www.opengis.net/sld"; 
xmlns:gml="http://www.opengis.net/gml"; xmlns:ogc="http://www.opengis.net/ogc"; 
version="1.0.0">
          <sld:NamedLayer>
            <sld:Name>roads_hebrew</sld:Name>
            <sld:UserStyle>
              <sld:Name>roads_hebrew</sld:Name>
              <sld:Title>roads hebrew</sld:Title>
              <sld:FeatureTypeStyle>
                <sld:Name>name</sld:Name>
                <sld:Rule>
                  <sld:Name>TypeRoad_1</sld:Name>
                  <sld:Title>TypeRoad_1</sld:Title>
                  <sld:PolygonSymbolizer>
                    <sld:Fill>
                      <sld:CssParameter name="fill-opacity">0</sld:CssParameter>
                    </sld:Fill>
                  </sld:PolygonSymbolizer>
                </sld:Rule>
                <sld:Rule>
                  <sld:Name>דרך �זורית 
קיימת/מ�ושרת</sld:Name>
                  <sld:Title>דרך �זורית 
קיימת/מ�ושרת</sld:Title>
                  <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                      <ogc:PropertyName>TypeRoad_1</ogc:PropertyName>
                      <ogc:Literal>דרך �זורית 
קיימת/מ�ושרת</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                  </ogc:Filter>
                  <sld:LineSymbolizer>
                    <sld:Stroke>
                      <sld:CssParameter name="stroke">#FF5500</sld:CssParameter>
                      <sld:CssParameter 
name="stroke-linecap">round</sld:CssParameter>
                      <sld:CssParameter 
name="stroke-width">1.2</sld:CssParameter>
                    </sld:Stroke>
                  </sld:LineSymbolizer>
                </sld:Rule>
              </sld:FeatureTypeStyle>
            </sld:UserStyle>
          </sld:NamedLayer>
        </sld:StyledLayerDescriptor>


Also in the GeoServer web ui the SLD looks scrambled:

https://i.imgur.com/IP5fbeP.png

I tried to set the UTF-8 encoding for the java environment, by adding the JAVA 
OPTION Dfile.encoding to the start.bat startup script:

        "%RUN_JAVA%" %JAVA_OPTS% -Dfile.encoding=UTF-8 
-DGEOSERVER_DATA_DIR="%GEOSERVER_DATA_DIR%" -Djava.awt.headless=true 
-DSTOP.PORT=8079 -DSTOP.KEY=geoserver -jar start.jar 

But this did not make any difference. 

Another thing I tried was setting a xml header (as suggested in this thread: 
http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-td5046063.html) to the 
SLD that is being posted to GeoServer, that includes the character encoding, 
but did not solve the issue either. 

A colleague of mine tried the same on a Ubuntu machine, with the locale set to 
(as suggested in the earlier mentioned mail list thread), with similar results:

        LANG=en_US.UTF-8
        LANGUAGE=en_US.UTF-8
        LC_CTYPE="en_US.UTF-8"
        LC_NUMERIC=fr_CH.UTF-8
        LC_TIME="en_US.UTF-8"
        LC_COLLATE="en_US.UTF-8"
        LC_MONETARY="en_US.UTF-8"
        LC_MESSAGES="en_US.UTF-8"
        LC_PAPER="en_US.UTF-8"
        LC_NAME="en_US.UTF-8"
        LC_ADDRESS="en_US.UTF-8"
        LC_TELEPHONE="en_US.UTF-8"
        LC_MEASUREMENT="en_US.UTF-8"
        LC_IDENTIFICATION="en_US.UTF-8"
        LC_ALL=



Can anyone shine light on what is happening here? Seems to me it is a bug in 
GeoServer, or are my colleague and me missing something in our GeoServer 
configuration?

Btw, I opened up a probably related issue on the issue tracker earlier today:  
https://osgeo-org.atlassian.net/projects/GEOS/issues/GEOS-8295.


Thanks and kind regards,
Anton Bakker

software developer@geocat <http://www.geocat.net/> 
tel. +31 318 416 664 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to