Setting the encoding in Eclipse or Netbeans

It’s the era of Unicode, and you though the problem of encoding is a story of the past. Well, not if you’ve got to view old code. This is what you may get:

Can you read it?

Eclipse allows you to set the encoding in Edit / Set encoding, but unfortunately it only offers UTF variants and standard encoding (cp1252 and ASCII). But what it didn’t tell you is: you can type in the box and access other code pages, like in this example, I want to view a file encoded with code page 949 (Korean)

Code page dialog

And the result…

Properly encoded

Here’s a small list of encodings for your reference:

List of encodings

In Netbeans

You can only set encoding for the whole project, by right-clicking the project and set the encoding:

Netbeans project properties

This is why I prefer Netbeans: it have a list of ALL encodings listed, you can just pick one and doesn’t have to remember the above list.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.