httpclient post 中文问题

当遇到中文的时候,不是所有的中文都需要UrlEncoded,

有的中文UrlEncoded反而不行,依照情况来定

httpost.setEntity(new UrlEncodedFormEntity(nvps,HTTP.UTF_8));

httpost.setEntity(new StringEntity(App2.entStr));

StringEntity stringEntity = new StringEntity(App2.entStr);
   stringEntity.setContentEncoding("utf-8");
   httpost.setEntity(stringEntity);

猜你喜欢

转载自m635674608.iteye.com/blog/2225280