MyEclipse 中文亂碼徹底解決:工作空間與源文件 UTF-8 編碼設置圖文教程
MyEclipse 中文亂碼通常源於工作空間編碼與 Java 源文件編碼不一致。只需兩步將兩者統一為 UTF-8 即可徹底解決。
步驟 1:設置工作空間編碼
- 打開 Window → Preferences。
- 展開 General → Workspace。
- 在 Text file encoding 區域選擇 Other,下拉選擇 UTF-8。
- 點擊 Apply and Close。

步驟 2:設置 Java 源文件編碼
- 打開 Window → Preferences。
- 展開 General → Content Types。
- 左側樹選中 Text → Java Source File。
- 右側 Default encoding 輸入框輸入 UTF-8,點擊 Update 按鈕(必須點 Update 生效)。
- 點擊 Apply and Close。

驗證與補充
- 已創建的文件需手動轉換:右鍵文件 → Properties → Resource → Text file encoding 改為 UTF-8。
- 項目層級覆蓋:右鍵項目 → Properties → Resource 同樣設置 UTF-8。
- 控制台編碼:Run Configurations → Common → Encoding 選 UTF-8,避免輸出亂碼。