Eclipse使用MyEclipse開發JSP網頁,如果有中文內容,會出現Encoding的警告訊息,且存檔後中文不見了?

如果使用MyEclipse開發JSP網頁時,在網頁中有使用中文的話,會出現下列錯誤訊息:
Encoding warning
The encoding(ISO-8859-1) cannot convert some characters (such as the one in position 308). Press ‘OK’ to save anyway (and some characters will be converted to ‘?” in the saved file), or press ‘Cancel’ to return to the editor.


解決此問題的方式是將網頁中的下列這行內容:
<%@ page language="java"%>
改為下列這行即可:
<%@ page language="java" contentType="text/html; charset=big5" %>
MyEclipse蠻厲害的!還能夠檢查到charset的設定。

在〈Eclipse使用MyEclipse開發JSP網頁,如果有中文內容,會出現Encoding的警告訊息,且存檔後中文不見了?〉中有 2 則留言

發佈回覆給「srain」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料

Secured By miniOrange