在存入数据库之前是用这个函数:
public String toChinese(String str){
    if(str==null){
    str  ="" ;
    }
    else{
        try {
       str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
        }
        catch (Exception ex) {
        }
    }
    return str ;
 }