• Resolved kuldeepsidhu88

    (@kuldeepsidhu88)


    I am using wp rest to fetch the posts in JSON format.But my site has non-english language.It is in Punjabi language.

    Link to My Site

    I am seeing the repoonse like this
    [{"id":489,"date":"2015-12-29T12:10:15","date_gmt":"2015-12-29T06:40:15","guid":{"rendered":"http:\/\/www.punjabireel.com\/?p=489"},"modified":"2015-12-29T12:43:18","modified_gmt":"2015-12-29T07:13:18","slug":"loona-dooja-ank-bhaag-3","type":"post","link":"http:\/\/www.punjabireel.com\/loona-dooja-ank-bhaag-3\/","title":{"rendered":"\u0a32\u0a42\u0a23\u0a3e – \u0a26\u0a42\u0a1c\u0a3e \u0a05\u0a70\u0a15 | \u0a2d\u0a3e\u0a17 – 3"},"content":{"rendered":"<h4 style=\"text-align: center;\"><span style=\"color: #ff8500;\"><a style=\"color: #ff8500;\" href=\"http:\/\/www.punjabireel.com\/loona-dooja-ank-bhaag-2\">\u0a32\u0a42\u0a23\u0a3e – \u0a26\u0a42\u0a1c\u0a3e \u0a05\u0a70\u0a15 | \u0a2d\u0a3e\u0a17 – 2 \u0a2a\u0a5c\u0a4d\u0a39\u0a28 \u0a32\u0a08 \u0a15\u0a32\u0a3f\u0a71\u0a15 \u0a15\u0a30\u0a4b<\/a><\/span><\/h4>\n<p style=\"text-align: center;\"><strong>\u0a35\u0a30\u0a2e\u0a28<\/strong><br \/>

    I dont know what is it but i am not able to see acutal content of the site.
    Please help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    The REST API uses wp_json_encode() under the hood to prepare the JSON response. wp_json_encode() transforms any special characters to Unicode, which is what you’re seeing in the response.

    Thread Starter kuldeepsidhu88

    (@kuldeepsidhu88)

    Thanks for this info. But how can we make it to show the actual characters of my local language? Could you point out if it requires any change in wordpress files/configuration?

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    But how can we make it to show the actual characters of my local language?

    Where are you rendering the data from the endpoint? You’ll be able to decode the Unicode on display.

    Thread Starter kuldeepsidhu88

    (@kuldeepsidhu88)

    I am trying to create an android app for my site.I am using ionic framework and wordpress-hybrid-client

    It actually uses this REST API plugin to fetch details from the website. In wordpres-hybrid-client, we have to configure the REST API endpoint.

    After configuring everything, i am not able to see the posts in the frontend, and i believe it is because of these characters(i may be wrong). As if i give some other english wordpress site REST endpoint, i am able to see posts in my application.
    This might be some setting required in the wordpres-hybrid-client library to decode the characters.
    Is there anything on wordpress side that would help fixing this issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘JSON response is not as expected (Non-english website)’ is closed to new replies.