第一种:
前台用URLEncoder.encode("中文","UTF-8")
如:
<%
String url="test.jsp?name="+URLEncoder.encode("中文","UTF-8");
%>
后台
先response.setCharacterEncoding("UTF-8");
再Stringname =new String(request.getParameter("name").getBytes("ISO-8859-1"),"UTF-8");
此方法适合用于前台不能用js来编码的情况。
遇到别的情况再继续加。大家也可以加啊。呵呵
有问题?直接google! <script type="text/javascript"><!-- google_ad_client = "pub-0757178726455256"; google_ad_format = "js_sdo"; google_cts_mode ="rs"; google_num_cts = "2"; google_searchbox_width = 215; google_searchbox_height = 26; google_link_target = 2; google_logo_pos = "left"; google_rs_pos = "right"; google_ad_height = 35; google_ad_width = 760; // --></script><script src="http://pagead2.googlesyndication.com/pagead/show_sdo.js" type="text/javascript"></script>
<script type="text/javascript"><!-- google_ad_client = "pub-0757178726455256"; /* 728x90, 创建于 09-6-17 */ google_ad_slot = "1633515232"; google_ad_width = 728; google_ad_height = 90; // --></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
646

被折叠的 条评论
为什么被折叠?



