eclipse设置默认编码UTF-8
1.设置文件的默认编码格式为UTF-8:
打开eclipse→Window→Preferences→General→Content Types
→在“Content types”中选择Text(或者Text中的单个文件)
→在“Default encoding:”后填上UTF-8
→点击后面的Update
→点击Ok(或Apply and Close)就可以啦
2.设置workspace默认编码格式为UTF-8:
Window→Preferences→General→Workspace
→将“Text file encoding”中Other选中并将后面的下拉框中改为UTF-8
→点击Ok就可以啦
3.设置新建文件的页面编码格式为UTF-8:
Window->Preferences->Web
→将“Encoding:”后选为ISO 10646/Unicode(UTF-8)
→点击Ok就可以啦
修改前
修改后