The new stringentity (params, "Utf-8") is specified as Utf-8 encoding try {HttpClient client = new Defaulthttpclient (); HttpPost HttpPost = new HttpPost (URL);//set encoding to prevent Chinese transmission garbled stringentity entity = new Stringentity (contentvalue.tostring (), " Utf-8 "); httppost.setentity (entity); HttpResponse response = Client.execute (HttpPost); Get the response code status = Response.getstatusline (). Getstatuscode ();//status = Response.getstatusline (). Getstatuscode (); LOG.V ("Jsondata", "resp =" + response.getentity (). toString ()); LOG.V ("Jsondata", "status =" + Status + "\ n" + contentvalue.tostring ());} catch (Exception e) {log.v ("Jsondata", "Exception"); E.printstacktrace ();}
This article is from the "climb over the mountains to see the Sea" blog, please be sure to keep this source http://670176656.blog.51cto.com/4500575/1627804
Post Chinese transcoding problem