字符串转码工具类:
package com.chb.abc.common.util;
import java.io.UnsupportedEncodingException;
public class CharacterUtil {
public static String stringTranscoding(String str){
if(str!=null && str.trim().length()>0 && str.trim()!=""){
try {
return new String(str.toString().getBytes("iso-8859-1"),"UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return str;
}
}