sybase插入漢字 2

 http://topic.csdn.net/f/1805/5001-5500.html

 

 public   String   chineseToUnicode(String   s)  
    {  
    try{  
   
                    byte[]   l=s.getBytes();  
                    s=new   String(l,"ISO8859_1");  
                    return   s;  
                    }  
                    catch(Exception   e){}  
                    return   "null";  
   
   
    }  
   
  /*unicode   to   chinese*/  
    public   String   getStr(String   str){  
        try{  
            String   temp_p=str;  
            byte[]   temp_t=temp_p.getBytes("ISO8859_1");  
            String   temp=new   String(temp_t);  
            return   temp;  
        }  
        catch(Exception   e){   }  
        return   "null";  
    }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章