Was just developing a Rails application with UTF-8 and noticed that characters where displayed wrong. After some examination of all headers etc. I researched a little and found that you simply have to edit /etc/netbeans.conf (for Mac users this is Contents/Resources/Netbeans/etc/netbeans.conf). Just insert a -J-Dfile.encoding=UTF-8 to netbeans_default_options.
February 23rd, 2009 at 12:19 pm
Thx, very handy article ;).
February 24th, 2009 at 9:36 am
it works, thx
March 3rd, 2009 at 5:28 pm
great, thx!
March 8th, 2009 at 8:52 am
it worked for farsi
thanks for your brief but useful article
March 22nd, 2009 at 10:06 pm
Hi,
thanks a lot for this. I was tearing my hair out trying to debug a mysql issue of he sort with netbeans only to understand by reading your article that it was displaying my variables with the wrong encoding (who would have thought)
Any idea why this setting isn’t the standard in netbeans? creation of files is already utf-8…
making the change to utf-8 in my apps has turned out to be reaaaaly difficult.
Ah well it is worth it
Kinda hate netbeans for wasting my time today hehe
many thanks,
Gregory Denturck - Brussels Belgium
March 31st, 2009 at 11:51 am
Awesome! Thanks!
July 23rd, 2009 at 1:23 pm
[…] http://wp.uberdose.com/2007/05/07/netbeans-and-utf-8/ […]
December 27th, 2009 at 9:13 pm
thank you for great advise !!!
January 16th, 2010 at 11:52 am
thx man
January 21st, 2010 at 10:20 am
Igazából ez a sor kell, így:
# command line switches:
netbeans_default_options=”-J-Dorg.glassfish.v3ee6.installRoot=\”C:\Program Files\sges-v3\” -J-client -J-Xverify:none -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dfile.encoding=UTF-8″
January 30th, 2010 at 3:31 pm
Thanks so much, it helped me a lot.
February 5th, 2010 at 2:01 pm
Thanks a lot!!!
June 8th, 2010 at 7:16 am
Does not work in 6.8. I have this line in c:\Program Files\Netbeans 6.8\etc\netbeans.conf
netbeans_default_options=”-J-client -J-Xverify:none -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dfile.encoding=UTF-8″
I open Netbeans 6.8. I create a new file. Open in with Editplus to check encoding. It sais ANSI.
August 21st, 2010 at 12:21 am
helo ..
it is not worked for me
i was trying this for last one week.
August 21st, 2010 at 12:23 am
this is my mail::khhanman5@gmail.com
if any one help…..
i am changed conf file but its not useful
December 17th, 2010 at 8:04 am
Thanks a lot, it works for NetBeans 6.9.
February 24th, 2011 at 2:15 pm
In 7.0 I’ve set the option -J-Dfile.encoding=UTF-8 to the netbeans_default_options line in netbeans.conf also.
And it seems to help somewhat. When I open a utf-8 javascript file in Netbeans, change something and save it. It remains utf-8. Excellent.
Now I create test.txt with Netbeans. When the file contains the string abdefg and I save it. It’s saved as ansi. When it contains ábcdefg it’s saved as utf-8.
March 29th, 2011 at 5:55 am
Really thanks
I was pulling my hair off my head then.
June 11th, 2011 at 5:29 am
Thaxnks a lot man!!! now the problem is i dont see the tamil unicode characters in netbeans… shows as BOXes…
June 11th, 2011 at 6:53 am
In Netbeans, go to Help -> About and see whether you have actually set the option -J-Dfile.encoding=UTF-8 to the netbeans_default_options line in netbeans.conf correctly.
The Help -> About screen should show UTF-8 on the System line:
Product Version: NetBeans IDE 7.0 (Build 201104080000)
Java: 1.6.0_15; Java HotSpot(TM) 64-Bit Server VM 14.1-b02
System: Windows 7 version 6.1 running on amd64; UTF-8; nl_NL (nb)
Userdir: C:\Users\chrisellen\.netbeans\7.0
June 14th, 2011 at 3:32 am
Hi eveer1!!
————
My “conf”, [C:\Program Files\NetBeans 7.0\etc\netbeans.conf]
————
netbeans_default_options=”-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=384m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true
-J-Dfile.encoding=UTF-8″
My Help>About
————
Product Version: NetBeans IDE 7.0 (Build 201104080000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Users\shri\.netbeans\7.0
My swing GUI
————-
*. showing corectly for chineese unicode charectors
but, not for tamil unicode(only boxes).
Whats goin wrong???
Seems to be .conf file not effecting the Netbeans runtime… but how could it be??
Am I editing the wrong .conf file??
June 14th, 2011 at 8:15 am
Your System line in Help about clearly doesn’t show UTF-8.
You file path C:\Program Files\NetBeans 7.0\etc\netbeans.conf seems to be the correct one.
Did you really save the conf file? Did you restart Netbeans after changing the config?
June 14th, 2011 at 1:25 pm
@christian
thanks 4 the reply…
yes i have did everything… now i have wasted plenty of hours with this… dont know what to do!!! :(((
June 14th, 2011 at 1:37 pm
its working perfectly without netbeans. (through CMD).
.properties files encoded in UTF-8.
problem should be there in netbeans. or I am missing something…
June 16th, 2011 at 3:06 pm
At last I found a solution…but not the perfect one…simply, Deploy to jar and run…here are the steps…
1. Set your project as main project… R-click>Set As Main Project.
2. Clean And Re-Build Project.
3. Go to… “\dist” then Double Click “.jar”
Its working fine…
September 21st, 2011 at 11:24 am
Worked on my MacBook under Snow Leopard
October 4th, 2011 at 10:52 am
If you are getting square boxes, it isn’t a UTF-8 issue it’s a FONT issue. The font can’t display the character properly. I followed this guide and still had the problem then realised it was the font. Changed my font to Monospaced and they show. I’m on Linux, Netbeans 7.0.
October 4th, 2011 at 2:36 pm
Hi James, The problem is.
Out side the NB 7 its working correctly.
(By running through the command prompt).
But,
Through the NB7 its not displaying correctly..
October 26th, 2011 at 11:04 am
it worked for me. i was trying to use arabic text. before configure it looked like a square. but now i can see it on editor. thank you for that little instruction but very useful.