How to display chinese character in Eclipse console

By default, Eclipse will output Chinese or non-English characters as question marks (?) or some weird characters. This is because the Eclipse’s default console encoding is Cp1252 or ASCII, which is unable to display other non-English words.

To enable Eclipse to display Chinese or other non-English characters correctly, do following :

1. In Eclipse, right click on your application class, and choose Run As –> Run Configurations

2. In Common tab, Encoding group, click on the “Other” and select the UTF-8.

3. Done, Eclipse is able to display the Chinese character now.

eclipse in utf-8 output
Note
The main idea is to change the output decoding to UTF-8.

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
10 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
8 Comment authors
Jaywant DharwadkarGOWRI SANKARJecaAndreeaNate Recent comment authors
newest oldest most voted
Jaywant Dharwadkar
Guest
Jaywant Dharwadkar

Request you to let us know how to set the encoding during the runtime on J2EE servers ?
We have tried to set the System.setProperty(“file.encoding”, ENCODING_ISO88591)
but it does not work. How ever if we run the program with the above setting in debug configuration by selecting the custom encoding than it works.

Request you to advice. Appreciated your help.

Andreea
Guest
Andreea

Thank you!

Nate
Guest
Nate

great! that helped a lot :) :)
Thank U !!

trackback
Display a list of countries in Java

[…] How To Display Chinese Character In Eclipse Console […]

whspecial
Guest
whspecial

great!

Ashley
Guest
Ashley

The information is very helpful, thanks:-)

Caprice Lewczyk
Guest
Caprice Lewczyk

Great information :)

trackback
Spring – resource bundle with ResourceBundleMessageSource example

[…] P.S Make sure your Eclipse is able to display the Chinese output. […]

GOWRI SANKAR
Guest
GOWRI SANKAR

thanks, mkyong! such a great treasure of information.

Jeca
Guest
Jeca

Thank you so much! :) This was giving me a major headache!