Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set the encoding to utf-8 in NetBeans 6.9?

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.

like image 826
Citizen Avatar asked Feb 17 '11 16:02

Citizen


People also ask

How do I change character Encoding in NetBeans?

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.

How do I change my Encoding to UTF-8?

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.


3 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

like image 88
DimG Avatar answered Oct 06 '22 05:10

DimG


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 ...

like image 36
LordofFatality Avatar answered Oct 06 '22 04:10

LordofFatality


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.

like image 21
vinsa Avatar answered Oct 06 '22 05:10

vinsa