[Programming] jsp 中文亂碼
防止jsp中文亂碼的問題,在jsp的最前面加上這兩行:
page language="java" contentType="text/html; charset=Big5"
request.setCharacterEncoding("big5");
第一行和第二行分開做scriptlet宣告;第一行scriptlet宣告後要加@。
討論串:
http://www.javaworld.com.tw/jute/post/print?bid=6&id=4891
頁面如果還會有亂碼,加入下面的codes
//
// Chinese Characters setup
//
response.setContentType("text/html;charset=Big5");
request.setCharacterEncoding("Big5");
0 Comments:
Post a Comment
<< Home