Posted on 2007-09-13 10:23
G_G 閱讀(2033)
評論(6) 編輯 收藏 所屬分類:
Inspiration
IE的URI的提交是有壓縮的(google好象有)所以utf-8對ie 不太好用我們?yōu)榱朔奖鉯e統(tǒng)一gbk
???1.Tomcat 的 server.xml 的 Connector 中加入
URIEncoding="GBK"???2.??server?類中加入
??????? rpo.setCharacterEncoding("GBK");
????????req.setCharacterEncoding("GBK");
????????rpo.setContentType("text/html; charset=GBK");?? 3.jsp 頁面加入
??????? <%@ page pageEncoding="GBK"%>
??????? <%@ page contentType="text/html; charset=GBK" %>?
IE亂碼問題解決.如果還沒解決那就@#$%......
FF的uri 好象默認是UTF-8 所以用 GBK就不方便了 就同上面的 改 UTF-8 就可以了
FF 和 IE 一起方便使用的我還沒找到 .
例代碼
?var?url?=?"/json/json?jsonStr="+?(new?fun()).toJSONString()?;?? //這 Ajax?就沒有亂碼了
?????????request.open("GET",?url,?true);
?????????request.send(null);
????????