I'm running NetBeans 6.9, can't seem to figure out where to set the encoding. I found some guides on google but all of them were for older versions.
4 Answers
The method by Mr. LordofFatality doesn't work for out-of-project files that you open via 'open file' menu.
In order to accomplish that, find a netbeans.conf
file in you netbeans installation\etc\
, find there a netbeans_default_options
line and add there -J-Dfile.encoding=UTF-8
string.
If you don't find the "netbeans_default_options" option there, add a whole new line as following:
netbeans_default_options="-J-Dfile.encoding=UTF-8"
Relevant to NetBeans 7.2, also works in 7.4

- 1,641
- 1
- 16
- 23
-
6+1. **IMPORTANT NOTE**: make sure to put the required option (*-J-Dfile.encoding=UTF8*) **inside quotes**. You can see that all values for `netbeans_default_options` are stored as ONE long string enclosed in quotes. – informatik01 Jul 12 '13 at 17:38
In 6.9.1:
- open the project pane if you don't see it already (Window > Projects);
- right-click on the name of your project in the tree-view;
- click properties;
- make sure the menu item "sources" on the left is highlighted;
- you should see "Encoding:" and a select-box next to it;
- click OK. Done.
It SHOULD work that way and does work for anyone on the internet except me. On my Windows XP dev system files are still not saved as UTF-8. Still wondering why ...

- 482
- 2
- 7
- 23

- 361
- 3
- 3
open the project pane if you don't see it already (Window > Projects) Right-click on the name of your project in the tree-view click properties make sure the menu item "sources" on the left is highlighted you should see "Encoding:" and a select-box next to it. click ok. done.
it SHOULD work that way and does work for anyone on the internet except me. on my windows xp dev system files are still not saved as utf-8. still wondering why...
Your file should content one or more non-latin chars, this is why.

- 1,132
- 12
- 25
its bug always the editor saving my files as utf-8 without bom

- 623
- 9
- 14
-
That's a feature request titled [UTF-8 files with signature (Byte Order Mark) not supported](https://netbeans.org/bugzilla/show_bug.cgi?id=161015). It has nothing to do with this question. – Álvaro González Aug 28 '15 at 15:12