eclipse设置UTF-8

1.修改workspace编码

windows->preferences->gengral->workspace

选择other->UTF-8。

 2.修改Content Types编码

windows->preferences->gengral->conten Types->Text

Default enconding–>UTF-8–>Update(这样把里面所有的文件设置为UTF-8编码)

 3.修改web下文件的编码

windows->preferences->web->(css files、html files、javaServer face、jsp files)

在enconding设置为ISO 10646/Unicode(UTF-8)

 4.修改项目的编码,对于导入的项目,包,类也可以单独去配设置

右键》properties》Resource

 testNG中文乱码

项目右键》Run as 》Run Configurations

原文地址:https://www.cnblogs.com/xl95/p/12737246.html