天天看點

Some characters cannot be mapped using 'ISO-8859-1' character encoding

MyEclipse中建立一個jsp檔案,如果輸入中文儲存時就會提示錯誤: Save could not be completed.Reason: some characters cannot be mapped using “ISO-8859-1“character encoding. Either change the encoding or remove thecharacters which are not supported by the “ISO-8859-1“ characterencoding.

幾種解決方法

1.eclipse --> window --> Preferences--> General --> Content Types--> Test --> 單擊 Java PropertiesFile,在底部出現 'Default edcodng:',改成utf-8或GBK,然後update. 雖然能儲存,但還必須利用native2ascii 來轉換一下,不然輸出還是亂碼.

2 應該使用eclipse的jinto插件編輯,會自動調用java的native2ascii把檔案轉碼。

jinto插件下載下傳:http://www.guh-software.de/jinto.html 

附: Eclipse下安裝Properties Editor

      在eclipse下"幫助"---"軟體更新"--"查找并安裝"--"搜尋要安裝的新功能部件"---"下一步"---"建立遠端站點"---

        填寫"名稱":Properties Editor;

        URL為:http://propedit.sourceforge.jp/eclipse/updates/點完成,

          讓它自己下載下傳插件..

        找到合适的Properties Editor安裝,這一個插件是減少轉化為utf-8格式,在struts自動轉換的.

這樣,eclipse插件就可以自己安裝一些。