中文转换问题
public static final String readstr(String str)
{
try{
byte[] temp_t=str.getBytes("ISO8859-1");
String temp=new String(temp_t,"gb2312");
return temp;
}catch(Exception e){}
return "null";
}
public static final String writestr(String str)
{
try{
byte[] temp_t=str.getBytes("gb2312");
String temp=new String(temp_t,"ISO8859-1");
return temp;
}catch(Exception e){}
return "null";
}
public static final String readstr(String str)
{
try{
byte[] temp_t=str.getBytes("ISO8859-1");
String temp=new String(temp_t,"gb2312");
return temp;
}catch(Exception e){}
return "null";
}
public static final String writestr(String str)
{
try{
byte[] temp_t=str.getBytes("gb2312");
String temp=new String(temp_t,"ISO8859-1");
return temp;
}catch(Exception e){}
return "null";
}
to csdn_search(世纪传人):收到!继续关注ing...