Gson automatically converts some characters to Unicode escape characters. What should I do ?, Gsonunicode
Recently, when using a Rich Text Editor to edit materials, we found many Unicode-encoded characters in the mass message content.
Later, it was discovered that Gson was improperly used.
Gson gson = new Gson (); String articleListStr = gson. toJson (articleList); // upload the clip to the server. The system sends a mass message, which is actually the clip on the server. String resposeString = HttpUtils. post (createNewsUrl, articleListStr );
Originally, Gson converted html tags into Unicode escape characters. The group content is abnormal.
The correct method is:
Gson gson = new GsonBuilder ().DisableHtmlEscaping (). Create ();
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.