Android default charset when sending http post/put - Problems with special characters

后端 未结 4 1641

I have configured the apache httpClient like so:

HttpProtocolParams.setContentCharset(httpParameters, \"UTF-8\");
HttpProtocolParams.setHttpElementCharset(ht         


        
4条回答
  •  青春惊慌失措
    2020-12-08 09:11

    You should set charset of your string entity to UTF-8:

    StringEntity stringEntity = new StringEntity(urlParameters, HTTP.UTF_8);
    

提交回复
热议问题