Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default encoding in NetBeans 8.0 [duplicate]

I'm wondering if I can change default encoding in NetBeans 8.0... I searched a lot but I haven't find a way how to change the encoding in this version of NetBeans.

I have this tag in my html document: <meta charset="utf-8">

BUT! As you can see on attached image, NetBeans notice is warning me about an encoding problem.

Internal encoding declaration "utf-8" disagrees with the actual encoding of the document ("windows-1250")

Internal encoding declaration "utf-8" disagrees with the actual encoding of the document ("windows-1250").

I created index.html by "new file" function in NetBeans. There is UTF-8 encoding in project properties, so I think it should be UTF-8. I really don't know where that 'windows-1250' came from!!

Where I can find some option to change default encoding or even current file encoding in NetBeans 8.0?

like image 681
Daniel Lengyel Avatar asked Jul 16 '14 10:07

Daniel Lengyel


People also ask

How do I change the default 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 system encoding?

Open Windows Control Panel -> Region. Go to the Administrative tab and click Change system locale... Remove the check mark next to Beta: Use UTF-8 for worldwide language support. Click OK and restart your computer.


2 Answers

Solution given by Danny

Navigate to <Netbeans installation directory>/etc and open the netbeans.conf file.

Add -J-Dfile.encoding=UTF-8 at the end of the line that starts with netbeans_default_options (make sure to include the leading space).

Restart Netbeans and it should be in UTF-8

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

like image 107
Rex Wagenius Avatar answered Oct 07 '22 21:10

Rex Wagenius


Answer here worked well for me on Netbeans 7.3 Stackoverflow Answer

Right click on the project name and click on properties. Sources tab -> Encoding and change it to whatever you need. In my case i needed Windows 1252 encoding.

like image 36
Lloyd Erasmus Avatar answered Oct 07 '22 20:10

Lloyd Erasmus