用以下函数,如next=getCN(next);
public class getCN
{
public String getString(String str)
{
if (str==null)
{
return "";
}
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 "";
}
}
}
public class getCN
{
public String getString(String str)
{
if (str==null)
{
return "";
}
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 "";
}
}
}
public static String getStr(String str){
try{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);System.out.println(temp);
return temp; }
catch(Exception e){ }
return "";
}
2.页面编码设置为gb,读取得时候如果是在windows平台下,可以直接读取,如果是在linux下则可能需要重新编码,我没有试验。