SPRING REQUEST 是GBK, 如果遇到乱码 InputStreamReader isr = new InputStreamReader(is,"GBK");

StringBuffer sb = new StringBuffer() ;
             InputStream is = request.getInputStream();
             InputStreamReader isr = new InputStreamReader(is,"GBK");  
             BufferedReader br = new BufferedReader(isr);
             String s = "" ;
             while((s=br.readLine())!=null){
             sb.append(s) ;
             }
             String str =sb.toString();

posted on 2018-01-17 21:00  丛林摄影狮  阅读(263)  评论(0编辑  收藏  举报

导航