1

I have a shapefile with french accent and needs to be published in geoserver 2.11.2. I have my geoserver in tomcat 8.5 and am using Ubuntu 14.04. The french accents are showing fine in get feature info but the issue is only when saving those characters in SLD, the french accents gets changed to junk characters.I have set my encoding as UTF-8 in SLD

enter image description here

enter image description here

But when i see the encoding of the file after saving by command file --mime-encoding it is in us-ascii instead of UTF-8.

enter image description here

  • please add the actual text of the SLD so we can test with it – Ian Turton Sep 22 '17 at 8:14
1

I believe the encoding is SLD is ignored, what you need to do is set it in the virtual machine. See:

https://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding

  • I have set this in my Java opts and restarted, but no luck – User123 Sep 22 '17 at 7:54
1

I can't reproduce this on Ubuntu 16.06, GeoServer 2.10.x & 2.11.2. I upload your SLD using the GUI (and after removing the filters) get a legend with accents:

enter image description here

file --mime-encoding data_dir/styles/ian.sld gives data_dir/styles/ian.sld: utf-8 as expected.

  • Do we need to set any specific settings in Ubuntu for setting encoding? For me after uploading SLD file, its showing as us-ascii. I have shared my snpashot – User123 Sep 22 '17 at 9:39
  • what is your locale? mine is en_GB.UTF-8 which might help, but no special settings – Ian Turton Sep 22 '17 at 9:40
  • When i type locale i am getting below locales LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.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= – User123 Sep 22 '17 at 9:41
  • 1
    my java command is /usr/lib/jvm/jdk1.8.0_111/bin/java -DGEOSERVER_DATA_DIR=/home/ian/Documents/astun/geoserver/geoserver-training/geoserver-2.11.2/data_dir -Djava.awt.headless=true -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -jar start.jar – Ian Turton Sep 22 '17 at 10:10
  • I now reinstalled every setup and tried and its working now. I will find the root cause and will update here – User123 Sep 22 '17 at 10:45

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