Eclipse – Display Non-English Unicode Characters

If you are a non-English speaking country native, and you are testing your application for your locale, then you may face difficulty in testing your application through the eclipse console. By default, Eclipse converts non-english characters as question marks (?) or some weird characters because by default eclipse’s console encoding is Cp1252 or ASCII.

1. Changing Default Encoding for a Project

You can easily change the default encoding to UTF-8 i.e. Unicode by setting in the Resource menu as follows. You can find the Resources menu in the project properties.

Eclipse change default encoding to unicode

2. Global Configuration

If you want to apply Unicode UTF-8 for all projects all the time, then you should set it in eclipse.ini file.

-Dfile.encoding=UTF-8

3. Demo

Now when you use any non-English character in IDE and even print in the console, it works perfectly.

Successful Eclipse Unicode Translation
Successful Eclipse Unicode Translation

Here If you do not add Unicode support then the above program will look like this.

Incorrect Eclipse Unicode Translation
Incorrect Eclipse Unicode Translation

Drop me comments if something is not clear.

Happy Learning !!

Comments

Subscribe
Notify of
guest
3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.