Dashboard encoding problem

70 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

Luka Lazovic

unread,
Oct 27, 2021, 9:36:19 AM10/27/21
to mapstore-users
Hi, 

I have a problem when creating widget on Dashboard, where Serbian Latin letters (ć, š, ž, č) are replaced with special characters. Mapstore and Geoserver are hosted on Windows with Tomcat. How can I solve this problem? I have tried many different solutions but they did not give an effect.

Best Regards,

Luka Lazovic

Lorenzo Natali

unread,
Nov 5, 2021, 11:34:49 AM11/5/21
to mapstore-users
Hi,
I don't have tried with MapStore Binary of 2021.02.00 on windows creating a dashboard with a text widget, copy and paste (ć, š, ž, č) in a text widget and saved as a new dashboard. Also title of the dashboard was (ć, š, ž, č).
I refersh the page but I didn't noticed anything. It works correctly to me. 
Maybe the data coming from GeoServer?

screenshot-dev-mapstore.geosolutionsgroup.com-2021.11.05-15_13_50.png

Luka Lazovic

unread,
Nov 5, 2021, 12:03:42 PM11/5/21
to mapstore-users
Hi Lorenzo,

It was problem with Java, I needed to add JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 into system variables.

Best Regards,

Luka

Lorenzo Natali

unread,
Nov 5, 2021, 12:07:16 PM11/5/21
to mapstore-users
Great!
Thank you for providing your solution.

Florent Gravin

unread,
Feb 24, 2023, 10:30:06 AM2/24/23
to mapstore-users
Hello there,

I wonder if you managed to make those encodings working in the print as well ?
Putting " í, á, é, š, č,....." in the title of the print removes the  č but displays well the í, á, é, š

I put 
env:
- name: JAVA_OPTS
value: -Xms512m -Xmx512m -XX:MaxPermSize=128m -Dgeorchestra.datadir=/etc/georchestra -DPRINT_BASE_URL=pdf -Dfile.encoding=UTF-8
- name: HOST
value: 0.0.0.0
- name: JAVA_TOOL_OPTIONS
value: -Dfile.encoding=UTF-8

in the Mapstore container.
I wonder if it's because MapfishPrint would have been built without the option or something like that ? Or a font issue ?  It's also weird that all the char work but the č

Do you guys have the same issue ?
Thanks

Lorenzo Natali

unread,
Mar 3, 2023, 4:13:59 AM3/3/23
to mapstor...@googlegroups.com
Did you try to follow this thread?


They suggest to use the variable, configure server.xml in tomcat and to modify the font in config.yml

--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/c803c7f7-30c7-4e3e-967b-d314ab82ecbbn%40googlegroups.com.

Florent Gravin

unread,
Mar 3, 2023, 7:35:26 AM3/3/23
to mapstore-users
Thanks Lorenzo for the hint, it helped me.
Still not able to fix it though.

I added JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 but it's not better.
I tried the DejaVu.ttf font but still nothing
I put fontEncoding: Identity-H in the config.yml but now i'm getting an error 

Error on printing: Error while generating PDF: java.nio.charset.UnsupportedCharsetException: Identity-H at java.base/java.nio.charset.Charset.forName(Charset.java:529) at com.itextpdf.text.pdf.PdfEncodings.convertToBytes(PdfEncodings.java:186) at 
com.itextpdf.text.pdf.Type1Font.<init>(Type1Font.java:277) at

So the last thing is the the 
<Connector
URIEncoding="UTF-8"

But i couldn't update that from the https://github.com/geosolutions-it/MapStore2/blob/15c079322f4ce44f73f957bd145a1bf209c695f2/binary/tomcat/conf/server.xml#L69
The server.xml deploy within the image is different.
So I tried to update the server.xml directly in the image, shutdown and restart tomcat, but still have the error.

Don't know if anyone was able to figure that out.
Thanks for the help anyway

Shai Sussman

unread,
May 18, 2023, 3:04:15 AM5/18/23
to mapstore-users
I have a similar problem that occurs only on WINDOWS (not on ubuntu)

see the image below, the text in the bar chart is not displayed correctly I am guessing this has got to do with wrong encoding.

I am not familiar with where EXACTLy do I need to set the variable in the JAVA_TOOL_OPTIONS?
can you provide me step by step where I need to make this modification as I am not familiar with modifying JAVA environment?
89369c24-8492-454d-9d1b-d8790b4cc3ee.jpeg

Lorenzo Natali

unread,
May 19, 2023, 4:07:25 AM5/19/23
to mapstore-users
Hi Shai, 
this issue you are reporting is not releated to printing. 
That labels are handled by plotlyJS and/or GeoServer(that is probably returning the labels ton the client in that way) and/or the proxy 
So I suggest to write another thread. 
I can suggest to see first the encoding and the response from GeoServer in developer tools to gather more information about the possible cause of this issue.
Reply all
Reply to author
Forward
0 new messages