How to display chinese character in Eclipse console
By default, the Chinese character will output as question mark (?) or some weird characters in the Eclipse console, this is because the default encoding is inherited from the project assocaited with the run configuration. Often times, the default encoding is Cp1252, which is unable to render the Chinese character correct.
Change the Eclipse console output
You need to change the run configurations.
1. Right click on your application class, and choose Run As –> Run Configurations
2. In Common tab, Console Encoding group, click on the “Other” and select the UTF-8
3. Run it, Eclipse IDE is able to display the Chinese character correctly.
- Java Core Technology - Java RegEx, Java XML, Java I/O, Java Misc
- J2EE Frameworks - Hibernate, Spring 2.5, Spring MVC, Struts 1.x, Struts 2.x
- Build Tools - Maven, Archiva
- Unit Test - jUnit, TestNG
- Client Scripts - jQuery
[...] P.S Make sure your Eclipse is able to display the Chinese output. [...]