@Test
public void xxx() throws ParseException, UnsupportedEncodingException, Exception {
ArrayList<JSONObject> list = new ArrayList<>();
String s = "Appliances jerry-built, poor quality clothing ...... still believe that "e-commerce custom products" more affordable";
JSONObject json = new JSONObject();
json.put("title", s);
JSONObject json1 = new JSONObject();
json1.put("title", s);
list.add(json);
list.add(json1);
System.out.println("old:"+list.toString());
System.out.println("new"+StringEscapeUtils.unescapeJava(list.toString()));
}
Output:
before transformation: [{“title”: “home appliances cut corners and poor clothing quality”}]
after transformation [{“title”: “home appliances cut corners and poor clothing quality”}]
after transformation [{“title”: “home appliances cut corners and poor clothing quality”} Also believe that “e-commerce customized products” are more affordable “}, {” title “:” home appliances cut corners, poor quality of clothing Also believe that “e-commerce customized products” are more affordable “}]
Read More:
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- The solution of “double quotation marks become escape characters” in Java parsing JSON
- Curl returns empty reply from server. Due to the processing of special characters, curl cannot be accessed and the browser can access it.
- JSON and map convert to each other (using fastjson)
- Solution to the problem that some special characters in finereport cannot be displayed or displayed as question mark
- The solution cannot be separated due to a special separator
- Regular expressions filter special characters
- The method of removing special characters in ABAP
- [MySQL] [serialize] [error record] after modifying data, no data will be returned (in fact, MySQL does not support it)
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)
- Solve the problem of using logback console to print log Chinese characters in IDEA as garbled characters
- Add a new springboot, and it will appear unable to read meta data for class when it is dependent
- You set the variable “no_check_targets“ here and it was unused before it went out of scope.
- How to make eclipse after the program is modified, click run to automatically save it.
- R reads JSON data
- Using AspectJ to transfer the data written to FTP service to MySQL database
- It can’t connect to local MySQL server through socket ‘/ tmp/ mysql.sock ‘(2) “;
- Solution to MySQL workbench error 1148 unable to load local data
- After canceling the startup of Ubuntu terminal, it will automatically enter the base environment of CONDA
- Solution of MySQL data garbled problem