public String translate(String str){//对传入的str字符串进行转换
String tempStr = "";
try{
tempStr = new String(str.getBytes("ISO-8859-1"), "GBK");//把"ISO-8859-1"转化为“GBK”编码
tempStr = tempStr.trim();
}catch (Exception e){
System.err.println(e.getMessage());
}
return tempStr;
}