Java 如何在Android应用程序中显示波斯语或阿拉伯语字母wordpress post?

Java 如何在Android应用程序中显示波斯语或阿拉伯语字母wordpress post?,java,android,localization,Java,Android,Localization,我有一个波斯语wordpress网站,现在我想获得JSON格式的数据,并在android应用程序上显示,我如何用波斯语来做呢 站点URL/wp-json/wp/v2/posts/ 或 站点\ URL/wp json/wp/v2/posts/?页面=1 我使用过这两种方法,但都不起作用,应用程序中的新闻部分为空,但显示了类别 public interface ApiService { String BaseURL= "https://irantopbet.net/";

我有一个波斯语wordpress网站,现在我想获得JSON格式的数据,并在android应用程序上显示,我如何用波斯语来做呢

站点URL/wp-json/wp/v2/posts/

站点\ URL/wp json/wp/v2/posts/?页面=1

我使用过这两种方法,但都不起作用,应用程序中的新闻部分为空,但显示了类别

public interface ApiService {
          String BaseURL= "https://irantopbet.net/";

          /*category() used for fetch main category list*/
          @GET("wp-json/wp/v2/categories?per_page=100")
          Call<JsonElement> category();

          /*getFeatureNews() used for featuresnews list*/
          @GET("wp-json/wp/v2/posts")
          Call<JsonElement> getFeatureNews();

          /*contactus used for add contact details */
          @FormUrlEncoded
          @POST("api/contact_us.php")
          Call<JsonElement> contactus(@Field("name") String name, @Field("email") String email, @Field("message") String message);

          /*getNewsByCatID used for fetch news using category id*/
          @GET("wp-json/wp/v2/posts?")
          Call<JsonElement> getNewsByCatID(@Query("categories") String catID);

          /*search used for search all project content*/
          @GET("wp-json/wp/v2/posts/?")
          Call<JsonElement> search(@Query("search") String world);

          /*getNewsByNewsID used for get news detais*/
          @GET("wp-json/wp/v2/posts/{NewsId}")
          Call<JsonElement> getNewsByNewsID(@Path("NewsId") String newsID);

          /*getAllComment used for view all comments*/
          @GET("wp-json/wp/v2/comments")
          Call<JsonElement> getAllComment(@Query("post") String postId);

          /*addComment used for add comment in news details*/
          @FormUrlEncoded
          @POST("api/comment.php")
          Call<JsonElement> addComment(@Field("post_id") String postId,
                                       @Field("comment_author") String commentAuthor,
                                       @Field("comment_author_email") String commentAuthorEmail,
                                       @Field("comment_content") String commentContent,
                                       @Field("user_id") String userId);

          /*getAllLatestNews used for all latest news list*/
          @GET("wp-json/wp/v2/posts?")
          Call<JsonElement> getAllLatestNews(@Query("categories") String 
          catID,@Query("page") int per_page);
}
公共接口服务{
字符串BaseURL=”https://irantopbet.net/";
/*category()用于获取主类别列表*/
@获取(“wp json/wp/v2/categories?每页=100”)
调用类别();
/*getFeatureNews()用于FeatureNews列表*/
@获取(“wp-json/wp/v2/posts”)
调用getFeatureNews();
/*用于添加联系人详细信息的contactus*/
@FormUrlEncoded
@POST(“api/contact_us.php”)
呼叫联系人(@Field(“name”)字符串名称、@Field(“email”)字符串电子邮件、@Field(“message”)字符串消息);
/*用于使用类别id获取新闻的getNewsByCatID*/
@获取(“wp-json/wp/v2/posts?”)
调用getNewsByCatID(@Query(“categories”)字符串catID);
/*搜索用于搜索所有项目内容*/
@获取(“wp-json/wp/v2/posts/?”)
调用搜索(@Query(“search”)字符串世界);
/*用于获取新闻详细信息的getNewsByNewsID*/
@获取(“wp-json/wp/v2/posts/{NewsId}”)
调用getNewsByNewsID(@Path(“newId”)字符串newId);
/*getAllComment用于查看所有注释*/
@获取(“wp-json/wp/v2/comments”)
调用getAllComment(@Query(“post”)字符串postId);
/*addComment用于在新闻详细信息中添加评论*/
@FormUrlEncoded
@POST(“api/comment.php”)
调用addComment(@Field(“post_id”)字符串posted,
@字段(“注释作者”)字符串注释作者,
@字段(“评论作者电子邮件”)字符串commentAuthorEmail,
@字段(“注释内容”)字符串注释内容,
@字段(“用户id”)字符串(用户id);
/*getAllLatestNews用于所有最新新闻列表*/
@获取(“wp-json/wp/v2/posts?”)
调用getAllLatestNews(@Query(“categories”)字符串
catID,@Query(“page”)int/页);
}
这将起作用,类别显示在应用程序中

但是
打开此链接时,链接上有内容,但应用程序中没有显示任何内容

您似乎已经从服务器接收到unicode字符。这意味着您必须将这些unicode字符转换为波斯语字符。请按照以下答案回答:

您似乎已经从服务器接收到unicode字符。这意味着您必须将这些unicode字符转换为波斯语字符。请按照以下答案回答: