代码

作者: 李_战 | 来源:发表于2017-10-19 20:05 被阅读0次

privateStringpostUrlDataResult(String strArry) {

try{

URL realurl =newURL(strArry);

BufferedReader reader =newBufferedReader(newInputStreamReader(realurl.openStream()));

StringBuilder inputLine =newStringBuilder();

String str ="";

while((str = reader.readLine()) !=null) {

inputLine.append(str);

}

str = inputLine.toString();

if(str.contains("

str = str.substring(str.indexOf(">") +1,str.lastIndexOf("<"));

logger.debug("addLeaveApply原str:  "+ str);

str = StringEscapeUtils.unescapeJava(str);

str = Dbc1EncodeUtils.decodeUnicode(str);

logger.debug("addLeaveApply解码Unicode str:  "+ str);

logger.debug("addLeaveApply str:  "+ Dbc1EncodeUtils.iso88591ToGbk(str) +"  :"+ Dbc1EncodeUtils.gbkToIso88591(str) +"  :"

+ Dbc1EncodeUtils.gbkToIso88591(str) +" : "+newString(str.getBytes(),"UTF-8"));

logger.debug("addLeaveApply str解码:  "+ Dbc1EncodeUtils.urlDecode(str));

returnstr;

}

}catch(MalformedURLException e) {

e.printStackTrace();

}catch(IOException e) {

e.printStackTrace();

}

return null;

}

相关文章

网友评论

      本文标题:代码

      本文链接:https://www.haomeiwen.com/subject/vyypuxtx.html