When I try on an Ubuntu 16.06 box everything works fine so it looks to be a
specific windows error.
Ian
On 22 September 2017 at 01:15, Daniel Baird <[email protected]> wrote:
>
> That definitely looks like an encoding issue. To make absolutely sure your
> SLD is getting to GS with the right encoding, I would:
>
> - edit your SLD source with a good text editor and save it as UTF8
> - add <?xml version="1.0" encoding="UTF-8"?> as the first line of your
> SLD source
> - use curl at the command line to add it to GS via REST, and make sure you
> tell curl the content encoding with curl's header argument: -H
> "Content-Type: text/html; charset=UTF-8"
>
>
> On Thu, 21 Sep 2017 at 23:07 Andrea Aime <[email protected]>
> wrote:
>
>> Hi Anton,
>> I don't have experience with non western chars on the REST API, however,
>> try adding
>> "?raw=true" to your URL, to avoid GeoServer parsing and rewriting the
>> style, and see if that helps?
>>
>> Cheers
>> Andrea
>>
>>
>> On Thu, Sep 21, 2017 at 2:02 PM, Anton Bakker <[email protected]>
>> wrote:
>>
>>> 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 <+31%20318%20416%20664>
>>>
>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> 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
>>>
>>>
>>
>>
>> --
>>
>> Regards,
>>
>> Andrea Aime
>>
>> ==
>> GeoServer Professional Services from the experts! Visit
>> http://goo.gl/it488V for more information.
>> ==
>>
>> Ing. Andrea Aime
>> @geowolf
>> Technical Lead
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054 Massarosa (LU)
>> phone: +39 0584 962313 <+39%200584%20962313>
>> fax: +39 0584 1660272 <+39%200584%20166%200272>
>> mob: +39 339 8844549 <+39%20339%20884%204549>
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
>>
>> Le informazioni contenute in questo messaggio di posta elettronica e/o
>> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
>> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
>> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
>> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
>> darcene notizia via e-mail e di procedere alla distruzione del messaggio
>> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
>> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
>> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
>> principi dettati dal D.Lgs. 196/2003.
>>
>> The information in this message and/or attachments, is intended solely
>> for the attention and use of the named addressee(s) and may be confidential
>> or proprietary in nature or covered by the provisions of privacy act
>> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
>> Code).Any use not in accord with its purpose, any disclosure, reproduction,
>> copying, distribution, or either dissemination, either whole or partial, is
>> strictly forbidden except previous formal approval of the named
>> addressee(s). If you are not the intended recipient, please contact
>> immediately the sender by telephone, fax or e-mail and delete the
>> information in this message that has been received in error. The sender
>> does not give any warranty or accept liability as the content, accuracy or
>> completeness of sent messages and accepts no responsibility for changes
>> made after they were sent or for other risks which arise as a result of
>> e-mail transmission, viruses, etc.
>>
>> ------------------------------------------------------------
>> ------------------
>> 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
>>
>
> ------------------------------------------------------------
> ------------------
> 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
>
>
--
Ian Turton
------------------------------------------------------------------------------
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