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.

This article was posted in Java category.