Skip to main content
divyav90967713
Level 2
Apr 10, 2017 10:39 AM UTC
Solved

Sitemap charset

Hi, I am trying to build the sitemap using the ACS Commons(https://adobe-consulting-services.github.io/acs-aem-commons/features/simple-sitemap.html), but I need the charset set to UTF-8, but it returns ISO-8859-1. I have also set the encoding to 'UTF-8' in "Apache Sling Request Parameter Handling ", but it doesn't seem to pick this up. Is there anything else I'm missing here. Please suggest how we can set the charset to UTF-8. Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
-Joe-Accepted solution
Adobe Employee
Apr 11, 2017 11:07 PM UTC

You can set your server to use UTF-8 with the following settings

 

file.encoding=UTF-8

sun.io.unicode.encoding=UnicodeBig

sun.jnu.encoding=UTF-8

 

This can be done by running AEM from the command line with the following parameters (jar filename may need adjustment), or you can update your JVM_OPTIONS when using the start script.

 

java -Dfile.encoding=UTF-8 -Dsun.io.unicode.encoding=UnicodeBig -Dsun.jnu.encoding=UTF-8 -jar cq-quickstart-6.2.0.jar

7 replies

Peter_Puzanovs
Community Advisor
Community Advisor
Apr 10, 2017 10:47 AM UTC

Hi,

You can tell your SitemapServlet that you explicitly want UTF-8 by setting:

response.setCharacterEncoding(StandardCharsets.UTF_8.name());

in your doGet method.

Currently, https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/SiteMapServlet.java does not seem to have this specific setter.


Regards,

Peter

Translate
divyav90967713
Level 2
Apr 10, 2017 11:34 AM UTC

Thanks Peter. But that's the problem, we are using OOTB feature to build the Sitemap, I dont have my own SitemapServlet.

Translate
kautuk_sahni
Level 9
Apr 11, 2017 6:33 AM UTC

I have asked internal experts to have a look at this.

Meanwhile, please re-post your question on ACS commons as well :- http://adobe-consulting-services.github.io/acs-aem-commons/features/simple-sitemap.html

~kautuk

Translate
Kautuk Sahni
divyav90967713
Level 2
Apr 11, 2017 10:12 AM UTC

kautuksahni wrote...

I have asked internal experts to have a look at this.

Meanwhile, please re-post your question on ACS commons as well :- http://adobe-consulting-services.github.io/acs-aem-commons/features/simple-sitemap.html

~kautuk

 

Yes, I have done that. Thank you!

Translate
-Joe-Adobe EmployeeAccepted solution
Adobe Employee
Apr 11, 2017 11:07 PM UTC

You can set your server to use UTF-8 with the following settings

 

file.encoding=UTF-8

sun.io.unicode.encoding=UnicodeBig

sun.jnu.encoding=UTF-8

 

This can be done by running AEM from the command line with the following parameters (jar filename may need adjustment), or you can update your JVM_OPTIONS when using the start script.

 

java -Dfile.encoding=UTF-8 -Dsun.io.unicode.encoding=UnicodeBig -Dsun.jnu.encoding=UTF-8 -jar cq-quickstart-6.2.0.jar

Translate
divyav90967713
Level 2
Apr 13, 2017 4:22 AM UTC

Thank you! I will try this as well.

Translate
kautuk_sahni
Level 9
Apr 13, 2017 8:48 AM UTC

Please let us know, if this works.

~kautuk

Translate
Kautuk Sahni