How to change file encoding in NetBeans?

Dawid Ohia picture Dawid Ohia · Nov 9, 2010 · Viewed 133.7k times · Source

I want to change encoding of file in NetBeans IDE (ver 6.9.1), let's say from ANSII to UTF-8. How can I do that?

EDIT: I will be more precise. I don't want to change the default encoding in NetBeans. I want to only change encoding of the currently edited file.

Answer

Danny picture Danny · Jan 31, 2012

Go to etc folder in Netbeans home --> open netbeans.conf file and add on netbeans_default_options following line:

-J-Dfile.encoding=UTF-8

Restart Netbeans and it should be in UTF-8

To check go to help --> about and check System: Windows Vista version 6.0 running on x86; UTF-8; nl_NL (nb)