2010年6月20日 星期日

Eclipse 3.2.2開啟tag、jsp時,中文亂碼

首先在環境中是用BIG5。


遇到的問題:從同事eclipse中複製A.tag到我的eclipse上,結果打開一看,中文的部份變成亂碼,此程式中有加入頁面編碼為Big5(如:pageEncoding)。


暫時不理會,修改A.tag增加一行code,然後存檔,再發佈到tomcat上,run了之後,此段中文變成亂碼了。


原來要修改兩個地方。

 
Window → Preferences → General → Editors → File Associations
檢查File types是否已加入該檔案的副檔名*.tag,沒有的話,手動加入。

接著在 Window → Preferences → General → Content Type → Text → JSP → JSP Tag Definition下的「Default encoding」改成BIG5,再按下Update鈕。


然後重開eclipse即可解決。




參考資訊:
eclipse中編碼問題的解決方法

沒有留言:

<%-- = = = = = = = = = = = = = = = = = 以上 = = = = = = = = = = = = = = = = = --%>

高雄聚會餐館

ボードゲーム予定

ボードゲーム持っている

<%-- = = = = = = = = = = = = = = = = 以下空白 = = = = = = = = = = = = = = = = --%>