AEM cloud | Chinese text | Node and Resource API returning unreadable text | Community
Skip to main content
New Participant
October 18, 2022
Solved

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

  • October 18, 2022
  • 2 replies
  • 1201 views

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.

2 replies

milind_bachani
Employee
October 18, 2022

@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

New Participant
October 18, 2022

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

arunpatidar
arunpatidarAccepted solution
New Participant
October 18, 2022