0
votes

when call adapter to adapter using AdaptersAPI in java , getting response as rabish if it contains Arabic letters. below snippet of my code

HttpEntity requestEntity = new StringEntity(new Gson().toJson(params), 
ContentType.APPLICATION_JSON );
    HttpPost httpPost = new HttpPost(url);
    httpPost.setEntity(requestEntity);
    HttpResponse httpResp = adaptersAPI.executeAdapterRequest(httpPost);
    JSONObject response = adaptersAPI.getResponseAsJSON(httpResp);
1
Can you verify if the adapter you called is getting the response incorrectly ( from the backend that returned Arabic letters)? Or is the second adapter getting the response correctly , but when the first adapter ( calling adapter) gets the response from the second, it gets it incorrectly? - Vivin K
thank you @VivinK , second choice " the second adapter getting the response correctly , but when the first adapter ( calling adapter) gets the response from the second, it gets it incorrectly " - ismail

1 Answers

0
votes

the problem was found in parsing of json > adaptersAPI.getResponseAsJSON(httpResp);

my issue resolved by: adding this property -Dfile.encoding=UTF-8 in "jvm.options" ,or change json parsing method