How to change testNG Reporter.log() encoding to UTF-16
问题 I am using testNG with selenium. I have two kind of logger, one is log4j logger and the other is testNG Reporter.log() . Now the problem is I need to log some Chinese text. But it is coming as '????' instead of Chinese text. So I changed the log4j.properties file, just added two lines: log4j.appender.file=org.apache.log4j.DailyRollingFileAppender log4j.appender.file.encoding=UTF-16 Now in my log4j logs it is coming properly but in testNG Reporter.log() it's still coming as '?????'. Log4j log: