How to set character encoding in query builder API to read Russian locale content | Community
Skip to main content
Level 4
October 16, 2015
Solved

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

  • October 16, 2015
  • 2 replies
  • 806 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

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

2 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

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

user00725Author
Level 4
October 16, 2015

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