Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to set character encoding in query builder API to read Russian locale content

Avatar

Level 4

Hi All,

       We are using the below query builder API to read CQ page content information. But in our nodes we have Russian text as node property values. When we read using the below code, we are getting ??????? instead of actual value.

How to set character encoding in query builder API ?

Map<String,String> map=new HashMap<String,String>();            
            map.put("property", "jcr:primaryType");
            map.put("property.or", "true");
            map.put("property.1_value", "cq:PageContent");
            map.put("property.2_value", "dam:AssetContent");
            map.put("p.limit","-1");

            adminSession = slingRepository.loginAdministrative(null);

            query = builder.createQuery(PredicateGroup.create(map), adminSession);
            result = query.getResult();

Regards

Nivas

1 Accepted Solution

Avatar

Correct answer by
Level 10

Localization context needs to be set. Ex:-  <cq:setContentBundle language='' />

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Localization context needs to be set. Ex:-  <cq:setContentBundle language='' />

Avatar

Level 4

Hi Sham,

             Thanks for your quick reply, but the example you provided is for JSP. But we don't have any JSP, in java we are reading the page content using Query Builder API. How do we retrieve the localized content in java.

 

Regards

Nivas