例如:
public static String convertCode(String str)
{
if (str == null)
str ="";
try{
str = new String(str.getBytes("ISO-8859-1"),"GB2312");
}
catch(Exception ex){
return "";
}
return str;
}
public static String convertCode(String str)
{
if (str == null)
str ="";
try{
str = new String(str.getBytes("ISO-8859-1"),"GB2312");
}
catch(Exception ex){
return "";
}
return str;
}
解决方案 »
- 请各位大虾们看看这个是哪有错误。
- filter中的doFilter方法老是报NullPointException
- 弹出窗口
- 多台主机的网站怎么对应一个域名的 ?
- 急急急!每道题的ABCD选项为一组radio,如何在另外一个页面获取到底选中的radio. 在线等!
- 关于servlet中调用数据库连接的问题,对数据库的操作老是无效,求高手指点
- 请教:如何使用htmlparser取出head头里的base标签的href基地址?
- 今天刚刚可以上网!散分拉
- 输出数组中重复记录的下标
- 紧急求助(在线等)
- 在线提问:配置好tomcat后.jsp文件应该放到那个文件夹下,才能正确执行
- 请教高手关于错误也面的提问???
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}
{
try
{
String str = temp;
byte[] str_1 = str.getBytes("IOS8859-1");
String str_2 = new String(str_1);
return str_2;
}
catch(Exception e)
{
return temp;
}
}