Special characters rendering issue on dispatcher | Community
Skip to main content
New Participant
December 8, 2023

Special characters rendering issue on dispatcher

  • December 8, 2023
  • 1 reply
  • 772 views

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.

1 reply

EstebanBustamante
New Participant
December 8, 2023

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

Esteban Bustamante
NehaMa1Author
New Participant
December 11, 2023

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