数据库中表的中文显示问题 我从表单取得字段"目的地(distination):济南" String distination =request.getParameter("distination");然后进行数据库查询: select sendname from address where addressname = distination; 最后显示 <%=sendname%>时是乱码 该如何转换编码方式呢?望指教! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我从表单取得字段"目的地(distination):济南" String distination =request.getParameter("distination"); byte[] tmp = distination.getBytes("ISO8859-1"); distination = new String(tmp,"GBK");然后进行数据库查询: select sendname from address where addressname = distination; 最后显示 <%=sendname%>时是乱码 该如何转换编码方式呢?望指教! 正好反了, 提交到数据库的编码应该是ISO从数据库出来的编码应该再由ISO --- GBK 給你個最簡單的 distination = new String (request.getParameter("distination").getBytes("iso-8859-1"));不管用可以找我 从数据库出来的编码如何由ISO--GBK?望指教! String distination =request.getParameter("distination"); byte[] tmp = distination.getBytes("ISO8859-1"); distination = new String(tmp,"GBK");然后进行数据库查询: select sendname from address where addressname = distination; 最后显示 String sendname = rs.getString("sendname").trim().equals(""); tmp = sendname.getBytes("ISO8859-1"); sendname = new String(tmp,"GBK"); <%=sendname%>时是乱码 String sendname = rs.getString("sendname").trim().equals(""); tmp = sendname.getBytes("ISO8859-1"); sendname = new String(tmp,"GBK"); <%=sendname%>时是乱码并不需要进行代码中文转化处理你看下数据库中你要取出来的数据是否是中文正常显示在数据库中 jsp页面中如何判断文本框中输入的是数字,且小数点位数未超过六位 为什么我用jquery的demao做修改后,无法通过name获取属性值 请问大家,为什么直接修改了数据库里的值,如果不重起应用服务器的话,就不会显示修改后的值呢,还是显示以前的值 jsp做的登陆界面的问题! 如何进行并发测试?大家是如何处理并发的? 一小段jsp程序改为asp代码 各位高手帮一下忙 重金求教!!! 初学者有关servlet的问题! 请帮我看看错误? 我上不了csdn了!!!大家看看怎么回事,最好是这个网页的开发者!! 求一正则表达式 登陆问题
String distination =request.getParameter("distination");
byte[] tmp = distination.getBytes("ISO8859-1");
distination = new String(tmp,"GBK");
然后进行数据库查询:
select sendname from address where addressname = distination;
最后显示
<%=sendname%>时是乱码
该如何转换编码方式呢?望指教!
从数据库出来的编码应该再由ISO --- GBK
不管用可以找我
byte[] tmp = distination.getBytes("ISO8859-1");
distination = new String(tmp,"GBK");
然后进行数据库查询:
select sendname from address where addressname = distination;
最后显示
String sendname = rs.getString("sendname").trim().equals("");
tmp = sendname.getBytes("ISO8859-1");
sendname = new String(tmp,"GBK");
<%=sendname%>时是乱码
tmp = sendname.getBytes("ISO8859-1");
sendname = new String(tmp,"GBK");
<%=sendname%>时是乱码
并不需要进行代码中文转化处理
你看下数据库中你要取出来的数据是否是中文正常显示在数据库中