\u003d problem occurs when Android uses Gson to convert object class into Json object

The usual Gson parsing is as follows:

Gson gson=new Gson();  
String json=gson.toJson(T.class);  

In this case, the "=" sign appears in the value of the field in json, and the encoding format conversion will occur after Gson parses, so the problem of \u003d will appear.

Change it to the following:

Gson gson = new GsonBuilder().disableHtmlEscaping().create();
gson.toJson(T.class);

おすすめ

転載: blog.csdn.net/Android_LeeJiaLun/article/details/129303337