- 打開Eclipse或者MyEclipse
- Windows -> Preferences
- General -> Content type
- Java Class File
- Text目錄下
- CSS
- HTML
- Java Properties File
- Java Source File
- JavaScript Source File
- JSP
- Refactoring History File
- Refactoring History Index
- XML
- XML(illformed)
- 以上項目的Default encoding都改為UTF-8 並點擊 Update
- General -> Workspace
- Text file encoding更改為Other:UTF-8
- 點擊Apply OK
- 在自己開發的一個項目上點擊右鍵
- 項目右鍵->Properties 或者 左鍵點擊->Alt+Enter
- Resource
- Text file encoding 選擇 Other:UTF-8
- Apply OK
- 重啟Eclipse
- 經過上述5個步驟,Eclipse的中文編碼便設置完畢.
- 如數據庫中中文還是顯示問號及其亂碼
- 請檢查數據庫設置
- 代碼
- 過濾器
閱讀更多 程序員小新人學習 的文章