关于中文变乱码的问题,请兄弟姐妹帮忙 <%@ page language="java" contentType="text/html;charset=GBK"%><% request.setCharacterEncoding("GBK");%> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 请问 kenshin_z(诸葛量) 如何转换呀,需要用哪一种编码转换,谢谢 String s=new String(rs.getString("fieldName").getByte("ISO8859_1"));一定可以的 String TITLE=new String(request.getParameter("title").getBytes("8859_1"));我的这个代码是我从表单中取得数据然后执行存储。这样在取出来就不会有???问题了 public class toGBK { //String s_str; public toGBK() { } public static String Unicode_GBK(String str){ try{ if(str==null||str.equals("")) return ""; String s_str=null; s_str=new String(str.getBytes("8859_1"), "gb2312"); return s_str; }catch(Exception e) { System.out.println(e); return null; } } public static String GBK_Unicode(String str){ try{ if(str==null||str.equals("")) return ""; String s_str=null; s_str=new String(str.getBytes("gb2312"), "8859_1"); return s_str; }catch(Exception e) { System.out.println(e); return null; } }} jsp页面提交到action,中文乱码(服务器Tomcat5.0) 2个web服务器间知道文件路径怎么传递文件 struts2如何让session失效 tomcat...死掉,急。。。。 我做的网站为什么有几个字显示不出来? 用JAVA开发像Sohu博客这样的网站需要多长时间和费用? 刚开始学jsp,一个关于bean的调用问题 如何用request.getParameter()获得下拉框的值? 在线等待,为什么不能实现滚动条?! jdk+Tomcat调用beans的问题!急啊! 谁做过网站策划书?帮帮我! 关于SQL Server JDBC的问题?
public class toGBK {
//String s_str;
public toGBK() {
}
public static String Unicode_GBK(String str){
try{
if(str==null||str.equals(""))
return "";
String s_str=null;
s_str=new String(str.getBytes("8859_1"), "gb2312");
return s_str;
}catch(Exception e)
{
System.out.println(e);
return null;
}
}
public static String GBK_Unicode(String str){
try{
if(str==null||str.equals(""))
return "";
String s_str=null;
s_str=new String(str.getBytes("gb2312"), "8859_1");
return s_str;
}catch(Exception e)
{
System.out.println(e);
return null;
}
}
}