Skip to main content
New Member
Dec 8, 2023 11:47 AM UTC

Special characters rendering issue on dispatcher

Hi Team,

 

We are facing issue with rendering of special character like é from request parameter and it renders as ? on page source on dispatcher url, where as on publishers renders fine.

We checked the org.apache.sling.engine.parameters settings and utf-8 is set and dispatcher httpd.conf also UTF-8 is set as

AddDefaultCharset utf-8

 

url - example 

 

http://localhost:4502/content/abc/en/home/search.html?model=coupé

 

from publishers renders character fine but dispatcher shows on page as 

coup?

 

Also when try hitting like http://localhost:4502/content/abc/en/home/search.html?model=coupé&_charset_=ISO-8859-1

 

renders character fine on dispatcher.

on page 

<meta charset="UTF-8"/>
 

is already set.

 

Kindly share on inputs to check on same.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

EstebanBustamante
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Dec 8, 2023 2:03 PM UTC

Hi

 

I think you just need to encode and decode the text properly, you should do something like this:

1. Invoke your search with text decoded

search?model=coup%C3%A9

Then in your Java code, you could use something like this to decode:

String result = java.net.URLDecoder.decode(url, StandardCharsets.UTF_8);

 

Tool Reference: https://meyerweb.com/eric/tools/dencoder/

 

Hope this helps

Translate
Esteban Bustamante
NehaMa1Author
New Member
Dec 11, 2023 3:54 AM UTC

hi @estebanbustamante - We had tried the same but didn't solved the issue

Translate