Level 2
February 19, 2017
Question
JCR/POST encoding issue with characters like ľ š Ä Å¥....
- February 19, 2017
- 1 reply
- 2228 views
Hello everyone,
this is second post here, but now i have little bit more information this time.
I am still experiencing encoding issue when AEM/Sling is saving POST request to JCR.
Apache Sling request parameter handling - Default Parameter Encoding - is set to UTF-8
I have tried code attached below on instances of sling & AEM. Here are my results:
- (instance) - (Default parameter encoding setting) - (without _charset_ in request/ with _charset_ in request)
- Sling - not set - broken/working
- Sling - UTF-8 - working/working
- AEM(clean installation) - not set - broken/working
- AEM(clean installation) - UTF-8 - broken/working
- AEM(with our code) - UTF-8 - broken/working
We have also tried to set encoding of the request in the filters but it was not working.
Example after running both FORMs from code below:
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %> <% response.setCharacterEncoding("UTF-8"); %> <html > <head> <meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> </head> <body> <form method="POST" action="/content/joz/jcr:content" enctype="multipart/form-data"> text:<input type="text" name="textWith" value="ľ š Ä Å¥ ž ý á í"/><br> <input type="text" name="_charset_" value="UTF-8"><br><br> <input type="Submit" /> </form> <br><br><br><br> <form method="POST" action="/content/joz/jcr:content" enctype="multipart/form-data"> text:<input type="text" name="textWithout" value="ľ š Ä Å¥ ž ý á í"/><br> <input type="Submit" /> </form> <br><br><br><br> <form method="POST" action="/content/joz/jcr:content" enctype="multipart/form-data"> DELETE <input type="hidden" name="textWithout@Delete" value="delete text" /> <input type="hidden" name="textWith@Delete" value="delete text" /><br> <input type="Submit" /> </form> </body> </html>I don't really know what more can I do to solve this issue.
Is there any Encoding config for JCR, servlet or anything else?
Thanks for any help.