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.
On project explorer, right click on the project, Properties -> General -> Encoding. This will allow you to choose the encoding per project. I don't know about former versions of NetBeans, but currently (NetBeans IDE 8.1) this is the right solution for me.
UTF-8 Encoding in Notepad (Windows)Click File in the top-left corner of your screen. In the dialog which appears, select the following options: In the "Save as type" drop-down, select All Files. In the "Encoding" drop-down, select UTF-8.
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
In 6.9.1:
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 ...
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With