I am creating some new style with Postman. The main problem is that the new style was created with Unicode problem. It means I am seeing the new style has some character that are not Unicode.

URL : http://localhost:8090/geoserver/rest/workspaces/webgis/styles


<?xml version="1.0" encoding="UTF-8"?>
<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">
       <Title>export_output8464daf071_site_name_1_تپه قورچی</Title>
             <CssParameter name="fill">#bd8321</CssParameter>

and Content type is :


Style in GeoServer is :

<?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:Title>export_output8464daf071_site_name_1_ط·ع¾ط¸آ¾ط¸â€، ط¸â€ڑط¸ث†ط·آ±ط¹â€ ط؛إ’</sld:Title>
                  <sld:CssParameter name="fill">#bd8321</sld:CssParameter>
  • On my Ubuntu 20.04 box this works fine with curl and both ascii and binary data options. Are you on a windows machine by any chance?
    – Ian Turton
    Aug 12, 2020 at 8:03
  • @IanTurton Thank you . Yes it is windows server ... Aug 12, 2020 at 10:45
  • try "application/vnd.ogc.sld+xml;charset=UTF-8" as the content-type
    – Ian Turton
    Aug 12, 2020 at 12:57
  • I did it but the result is same :-( Aug 12, 2020 at 16:07

1 Answer 1


After a lot of googling , I understood Java on windows does NOT support Unicode output by default. As we know, GeoServer made by JAVA too, so we have to do some stuff for fixing this issue.

1. Add this variable to your System Environment Variable.


2. Open CMD (RUN AS Administrator) and run this command

C:\WINDOWS\system32>chcp 65001

and you will see this message : Active code page: 65001

Point 1 : Do not forget to restart your computer or 1 - close your explorer and open it and then 2 - restart you GeoServer service from Services.

Point 2 : Your XML should be start with :

<?xml version="1.0" encoding="UTF-8"?>

Point 3 : You do not need to add charset=UTF-8 in end of Content-Type. So you can set to :


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.