활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi Everyone,
Need help in reading some specific chinese chars from JCR repo.
I have one dialog where author enters content and save the page. Author created page for China and entered some content specific to China in the dialog and saved it.
When I try to read the below content from JCR it is adding ???? . I have tried adding utf-8 still not able to get the specific content.
String mDesc = properties.get("messageDescription", String.class);
result :<p>?????</p>
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
Hi @Anny0505,
If you are using Coral UI 3 textfield(granite/ui/components/coral/foundation/form/textfield) for your messageDescription field, try the solution highlighted in below article.
Setting utf-8 in hidden resource (Solution A) - https://helpx.adobe.com/experience-manager/kb/utf-characters-not-stored-or-displayed-properly-after-...
Also, check if UTF-8 is set at page component level (via meta tag in head section of a page)
If you're on latest version on AEM, you should not see this issue.
Try below approaches:
1. Make sure Default encoding is set to: utf-8 on Apache Sling Request Parameter Handling config.
2. Try below and see if it works:
String paramValue = "yourString";
byte[] bytes = paramValue.getBytes(StandardCharsets.ISO_8859_1);
paramValue = new String(bytes, StandardCharsets.UTF_8);
Let me know if it works or not.
Thanks,
Singaiah
Thnak you Singaiah. Still it did not work
조회 수
답글
좋아요 수
Hi @Anny0505,
If you are using Coral UI 3 textfield(granite/ui/components/coral/foundation/form/textfield) for your messageDescription field, try the solution highlighted in below article.
Setting utf-8 in hidden resource (Solution A) - https://helpx.adobe.com/experience-manager/kb/utf-characters-not-stored-or-displayed-properly-after-...
Also, check if UTF-8 is set at page component level (via meta tag in head section of a page)
Thank you @ Vijayalakshmi_S.
Actually When I save the dialog data saving correctly as shown in below. I need to read the data from publish instance and send it to some third party application. I have implemented listener to get the latest activated page content and reading data from the valueMap.
when I use String mDesc = properties.get("messageDescription", String.class); content converting to ?????.
Is there any other way to read this content?
I Also went through the article and followed same steps no luck
조회 수
답글
좋아요 수
Can you share your snippet of where exactly you are retrieving the value map object and hence messageDescription field and where you are seeing "???" characters?
I tried using chinese characters in textfield of my component dialog -> backed by Sling model (@ValueMapValue with getter for the same) -> Printing the value in HTL from the model using the same getter -> It displays fine on the page.
조회 수
답글
좋아요 수