-1

I am using SDL Tridion 2013 sp1, pages & components are published to broker DB as JSON format. Using DD4T 2.0 templates to generate JSON output.

Trying to consume the page & component presentation data from content broken in Angular 2 site using the DD4T Rest Service. I can able to retrieve the page json in proper format. I tried to retrieve the component data using below API call.

Syntax:http://myurl/componentpresentation/GetContent/{publicationId:int}/{id:int}
Example: http://myurl/componentpresentation/GetContent/5/123

API call return output as encoded chinese characters instead of component JSON data. I assume some decoding is required.

Please help me to resolve this. Thanks.

1
  • Hi @Bala, your question is not clear. Please update the exact requirement that you are trying to achieve. May be you can add more details like: what you have done already. If you are new with DD4T then please check the blogs. May be this will help(blog.trivident.com/setting-up-a-dd4t-20-web-application). Sep 11 '17 at 16:58
0

Solved the issue by adding below lines of code inside GetContent method in DD4T.RestService.WebApi ==> ComponentPresentationController

    byte[] bytes = Encoding.Unicode.GetBytes(content);
    content = Encoding.UTF8.GetString(bytes); 

Referred Component Presentations in SQL 2012 DB shows up as a different encoding with 2013 to fix the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.