[JSP ] submit 後中文字變亂碼
1.jsp code如下:
<%@page contentType = "text/html;charset=Big5" %>
<SCRIPT language="JavaScript">
function chkSend(){
document.form1.submit();
}
</script>
<html>
<form action='2.jsp' method='post' name='form1'>
<table>
<tr>
<td>
<textarea ROWS="2" COLS="50" name="reply"></textarea>
</td>
<tr>
<input type='button' class='button' value='下一步' onClick='chkSend()'></tr>
</table>
</form>
</table>
</html>
2.jsp的code
<%@page contentType = "text/html;charset=Big5" %>
<%
request.setCharacterEncoding("big5");
String reply=request.getParameter("reply");
%>
<html>
<table>
<tr>
<td><textarea ROWS="2" COLS="50" name="reply"><%=reply%></textarea></td>
</tr>
</table>
</table>
</html>
現在問題來了...在1.jsp裡面的textarea裡頭輸入一堆繁體字 裡頭穿插一各簡體字
submit到第二頁2.jsp..整各內容會變成肉眼無法看出啥意思的簡體編碼
請問板上各位大大,有無方法可以完整顯示出正確的內容
網路上google很久 試過很多方法卻得不到解答 謝謝
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 72.52.66.10
推
06/09 19:22, , 1F
06/09 19:22, 1F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):