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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

Avatar

Level 2

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

3 Replies

Avatar

Employee Advisor

@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

Avatar

Level 2

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