[Geoserver-users] SLD rest upload character problem

Hi everyone,
I have problems uploading an sld via REST. Special characters get converted into something I don’t like ;-). The problematic characters are ° and >. If I just copy the sld from my Texteditor (Notepad++) or use the upload funtcion in the interface I have no issues at all.

This is the REST call for uploading the sld:

curl -v -u %login% -XPUT -H “Content-type: application/vnd.ogc.sld+xml” -d @%slope%/Hangneigung.sld %url%/styles/Hangneigung_AUT

Could the content type be a Problem?
Cheers, Niko

Hangneigung.sld (1.25 KB)

Hangneigung.sld (1.25 KB)

Well the > should probably be > but the degree symbol should be fine. You may need to add ; charset=utf-8 to the end of the content-type though.

In my tests the degrees symbols round trip ok with and without the charset but I’m on linux so your mileage may vary.

Ian

···

Ian Turton

Thanks Ian,
just found out that the characters are changed during the upload of the sld BUT on the Client side legends appear correctly. So the characters are interpreted in the correct way (or at least the way I want them).
Cheers, Niko

Am Mi., 16. Okt. 2019 um 13:21 Uhr schrieb Ian Turton <ijturton@anonymised.com>:

Well the > should probably be > but the degree symbol should be fine. You may need to add ; charset=utf-8 to the end of the content-type though.

In my tests the degrees symbols round trip ok with and without the charset but I’m on linux so your mileage may vary.

Ian

On Wed, 16 Oct 2019 at 10:05, Nikolaus Pruzsinszky <nikopru77@…84…> wrote:

Hi everyone,
I have problems uploading an sld via REST. Special characters get converted into something I don’t like ;-). The problematic characters are ° and >. If I just copy the sld from my Texteditor (Notepad++) or use the upload funtcion in the interface I have no issues at all.

This is the REST call for uploading the sld:

curl -v -u %login% -XPUT -H “Content-type: application/vnd.ogc.sld+xml” -d @%slope%/Hangneigung.sld %url%/styles/Hangneigung_AUT

Could the content type be a Problem?
Cheers, Niko


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Turton