<%!
public String codeToString(String str)
{
String s=str;
byte[]tmp1=s.getBytes("ISO-8859-1");
s=new String(tmp1);
return s;
}
%>
byte[]tmp1=s.getBytes("ISO-8859-1");报错Unhandled exception type UnsupportedEncodingException
网上都说这么用啊 为什么??
public String codeToString(String str)
{
String s=str;
byte[]tmp1=s.getBytes("ISO-8859-1");
s=new String(tmp1);
return s;
}
%>
byte[]tmp1=s.getBytes("ISO-8859-1");报错Unhandled exception type UnsupportedEncodingException
网上都说这么用啊 为什么??
catch(Exception e){}一下就对了!这个报错是正常的!呵呵!
{
String s=str;
byte[] tmp1=null;
try {
tmp1 = s.getBytes("ISO-8859-1");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
s=new String(tmp1);
return s;
}