AEM cloud | Chinese text | Node and Resource API returning unreadable text | Community
Skip to main content
Level 2
Oct 18, 2022 12:23 PM UTC
Solved

AEM cloud | Chinese text | Node and Resource API returning unreadable text

Hi All,

 

I have Chinese content in node property. 

When I am reading this content using node.getProperty("text").getString()

 

or

 

ValueMap.get("text").toString()

 

Both these methods are returning non readable characters sequence like ??????

Could anyone help how to read Chine text in AEM. However English text is working fine.

 

Any pointers highly appreciated.

 

Thanks,

Pradeep

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Oct 18, 2022 1:27 PM UTC

3 replies

milind_bachani
Employee
Oct 18, 2022 1:32 PM UTC

@pradeepdubey hi - You need to use character encoding in that case. 
Also note, you will always see ??? when printing into logs - please try to write it on response for testing.

Thanks,

Milind

Translate
Level 2
Oct 18, 2022 2:04 PM UTC

I started and checked AEM in debug mode, text is in Chinese language, however log is printing invalid characters. 

When I copy paste the text on editor it is in Chinese only. Not sure why AEM node and resource API is not returning actual text.

Could you share any code/API which ensure same text is getting read and printed in logs?

 

Thanks,

Pradeep

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Oct 18, 2022 1:27 PM UTC