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;
}
网友评论