Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Replies

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,129 likes

Total Posts

6,140 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,129 likes

Total Posts

6,140 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

02-11-2016

Hi 

Pleas refer to this community article:-

Link:- http://adobeaemtips.blogspot.in/2015/11/utf-8-encoding-in-aem.html

// UTF- 8 Encoding in AEM

    AEM 6.1 : Go to Apache Sling Request Parameter Handling . Change the Default Parameter Encoding to "UTF-8"

    Encoding & Decoding while posting data to Sling Servlet :

    Decoding  in the Servlet.

    String id = java.net.URLDecoder.decode(request.getParameter("id"), "UTF-8");

    Encoding data before posting to a  Servlet

    String id= java.net.URLEncoder.encode("cust®", "UTF-8"); 

    Set charset encoding in a JSP :

    <%@ page contentType="text/html;charset=UTF-8" %> 
    <%@ taglib uri="/libs/CFC/resources/jstl/c.tld" prefix="c" %> 
    <form method="post"> 
    <input name="searchterm" value="<c:out value="${param.searchterm}" />" />
    <input type="submit" /> 

    </form>

 

Link:-http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// Unicode escape sequences: \u followed by 4 hexadecimal digits (e.g.: \u0022 for ", \u0027 for ', \u003c for <, or \u003e for >

 In HTL (Formerly known as Sightly), 

 Use:-   ${ '{0} {1} {2} {3}' @ format=['\u003e','\u003C', '\u002F', '\u005C']}

 This will print :-        > < / \

 

Link:- https://helpx.adobe.com/experience-manager/using/post_chars.html

// Posting Special Characters to Adobe Experience Manager

 

I hope this would help you.

~kautuk

Avatar

Avatar
Give Back 3
Level 1
MrynalKumar
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
Boost 1
View profile

Avatar
Give Back 3
Level 1
MrynalKumar
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
Boost 1
View profile
MrynalKumar
Level 1

27-04-2020

I also faced similar issue. Unicode character(special characters) passed as a request parameter getting converted to question mark(?).

issue-17-screen-1.jpg

Reason : Reason is the character encoding.

Solution :

# Solution 1
1. Configure 'Apache Sling Request Parameter Handling', Set the property 'Default Parameter Encoding'='iso-8859-1'
2. Take care of the character encoding (to UTF-8) through code
queryString = new String(request.getParameter(initialSearchConfig.getQueryStringParamName()).getBytes("iso-8859-1"), "UTF-8");

# Solution 2
1.Configure 'Apache Sling Request Parameter Handling', Set the property 'Default Parameter Encoding'='UTF-8'
2. Igonore the encoding through code
queryString = new String(request.getParameter(initialSearchConfig.getQueryStringParamName()));

Hope this help.