[Geoserver-devel] [2.12.0] Unknown style format when charset is in content-type

Hello,

I am facing a new issue since I upgraded my geoserver to v2.12.0.

I am using the REST API /workspaces/<ws>/styles/<s> to edit styles, and my
content type header is set to 'application/vnd.ogc.sld+xml;charset=UTF-8'.
This used to work in v2.11.x. But now this error is raised :

org.geoserver.rest.RestException 400 BAD_REQUEST: Unknown style format
'application/vnd.ogc.sld+xml;charset=UTF-8'
  at
org.geoserver.rest.catalog.StyleController.stylePut(StyleController.java:446)

I need to set the charset to UTF-8 because I have special characters in my
sld file like 'é' or 'è', which are not correctly handled without setting
the charset parameter in the content-type header.

Is there anything planned in order to fix this issue ?

Thanks in advance for your help.

Simon

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html

There was some discussion on stack exchange (https://gis.stackexchange.com/questions/256263/french-accents-changed-to-junk-characters-when-saving-the-sld-in-geoserver-2-11) but I wasn’t able to reproduce it and in the end the user couldn’t either.

In principle, it should work as UTF-8 without the need to specify it, or are you on windows?

Ian

···

On 30 November 2017 at 09:34, SimonC <simon.chatillon@anonymised.com> wrote:

Hello,

I am facing a new issue since I upgraded my geoserver to v2.12.0.

I am using the REST API /workspaces//styles/ to edit styles, and my
content type header is set to ‘application/vnd.ogc.sld+xml;charset=UTF-8’.
This used to work in v2.11.x. But now this error is raised :

org.geoserver.rest.RestException 400 BAD_REQUEST: Unknown style format
‘application/vnd.ogc.sld+xml;charset=UTF-8’
at
org.geoserver.rest.catalog.StyleController.stylePut(StyleController.java:446)

I need to set the charset to UTF-8 because I have special characters in my
sld file like ‘é’ or ‘è’, which are not correctly handled without setting
the charset parameter in the content-type header.

Is there anything planned in order to fix this issue ?

Thanks in advance for your help.

Simon


Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Ian Turton

No, I am on linux. You are right it seems to work without the charset when I
send the request directly via CURL. So I think the problem comes from my
java server who sends the request, I'll try the solutions in the discussion.

Thanks for your time.

Simon

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html