你得捕捉UnsupportedEncodingException
try{
String strTmp ;
strTmp = new String (reName.getBytes ("8859_1"), ("SJIS"));
}catch(UnsupportedEncodingException e){
}
try{
String strTmp ;
strTmp = new String (reName.getBytes ("8859_1"), ("SJIS"));
}catch(UnsupportedEncodingException e){
}
The named encoding is not supported
这时才出现你这个异常.
但是这条语句放在jsp网页中,不用捕获异常也是好使得。但是放在java beans中就编译通不过了。在jsp网页中
<%
String strTmp;
strTmp = new String (reName.getBytes("8859_1"), ("SJIS"));
%>
再jsp网页中就好使。大家借这帮我想办法啊。谢谢了
不是编码不支持,try{
}catch(){}就是要抓到编码不支持的情况
要是运行程序了,那时候出现抓到的编码不支持信息才是
既然jsp可以运行了,那么你的系统还是支持SJIS编码的
try{
String strTmp ;
strTmp = new String (reName.getBytes ("8859_1"), ("SJIS"));
}catch(UnsupportedEncodingException e){
}
编译应该没有问题了
然后运行看看
ToZenKaKu.java:42: シンボルを解釈処理できません。
シンボル: クラス UnsupportedEncodingException
位置 : IBMDb2BeansRvbell.ToZenKaKu の クラス
catch(UnsupportedEncodingException e)还有别的错误