final_request.setCharacterEncoding("UTF-8");
StringBuilder buffer = new StringBuilder();
BufferedReader reader=null;
try{
reader = new BufferedReader(new InputStreamReader(final_request.getInputStream(),"UTF-8"));
String line=null;
while((line = reader.readLine())!=null){
buffer.append(line);
}
}catch(Exception e){
e.printStackTrace();
}finally{
if(null!=reader){
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
buffer.toString()
request.getInputStream中文乱码解决方案
最新推荐文章于 2023-07-14 11:08:01 发布