netbeans and UTF8 encoding


When I started using Netbeans as my Ruby on Rails IDE, I noticed that, at least on my build, it did not use UTF 8 on files by default. If you speak english that usually is not a problem, but for me, who write software in portuguese, it is very important.
But, Mr. Google gave me a tip, and I’ll place it here so you don’t have to bother him again with this same question.
Theres a file, inside the /etc folder of netbeans directory, called netbeans.conf. I don’t know if it stays elsewhere in Linux, I’ll only know later today, but anyway, you should place this option inside the quotes of netbeans_default_options:
-J-Dfile.encoding=UTF-8
That’s it. Worked perfectly for me.
Best

About these ads

~ by Dante Regis on February 26, 2007.

38 Responses to “netbeans and UTF8 encoding”

  1. Hi,
    I’m the Community Docs Manager for NetBeans. This is the type of content we would like to feature on our NetBeans Community Docs wiki page. Would you like to contribute this in the form of “Tips and Tricks”? Please let me know if you’re interested.

    Thanks,

    James Branam
    NetBeans Community Docs Manager

  2. Hi James,

    I’m surely interested, and would be honored to help you guys.
    Best

  3. I want to make j2me application to display arabic UTF-8
    but I have ???? instead of a word of 4 letters ,so pleaze I need help to fix this problem.
    Note : I go to project properties and selest Build ,Colmpiing and write UTF-8 in Encoding but nothing work as I want.
    And I do what u write but nothing happened!
    Help me please!

  4. […] Bizu de pego deste blog. […]

  5. Thanks Dante Regis! Worked for me on OS X Leopard netbeans 6.1beta.

  6. Thanks! Did it for me too on WinXP, NB 6.0.1. Finally umlaute in the console… :) Hopefully they’ll put this into the settings menu in the next version…

  7. Thanks! That solved a lot of issues.

  8. Thanks a lot!!! Russian symbols in NB output console )

  9. I was happy to find this blog post, thinking it will solve my problem and I did add this to the conf file as described BUT unfortunately neither umlaute nor russian or anything else more “exotic” is displayed properly and all I see is � and ? (Vista, NB 6.1)
    I’m slowly getting frustrated here, does anything else also need to be set in some magical way or how did you guys get it to work properly???

  10. Hi, I hope somebody can help me. I’m working on this website English/Portuguese and for example on this page http://www.goulartfilmes.com/en//IvyGoulart/tabid/54/Default.aspx we can see the Portuguese accents on the page without any problems, but if click on the pictures, where I have names in Portuguese with accents (example “The Curator” enlarged photos 3rd pic) it shows me the funny symbols. I already checked the xml file and it’s with encoding=UTF-8 and after reading so many forums I made all the changes I thought could help, but nothing changed. Can somebody please help me with this?

  11. Oi Bruno, procurei fazer o que vc disse mas o Windows Vista não me deixa alterar este arquivo. Eu já tentei fazer com que o arquivo não fosse “apenas para leitura”, ele aceita fazer, mas no final tudo fica como antes. O que estou fazendo de errado?

  12. Answering the portuguese question of “Herótodo”, above…

    herótodo, talvez vc esteja com problemas de permissão no NTFS. Tente logar como administrador e modificar esses arquivos. Melhor ainda, enquanto estiver como administrador, aproveite para modificar a permissão do arquivo para que vc possa editá-lo com seu usuário normal. Eu não usei o vista direito ainda (e espero nao ser obrigado a fazê-lo tão cedo ;)), mas na época do XP, era só clicar com o botão direito e olhar em Compartilhamento e Segurança…

    Talvez tenha mudado um pouco no Vista, dá uma olhada em forums e no google pra ver como proceder para alterar permissões de arquivos.

    (He was having trouble editing the files on Windows Vista, and I’m suggesting him to look on file permissions for NTFS)

  13. I’ve tried the netbeans.conf solution here on Ubuntu Intrepid with NB 6.5 but it didn’t worked – I’ve changed all the evil ISO-8859-1 into UTF-8 I could find in .netbeans* files and in webpages and projects I created but nothing worked.

  14. For me it woked with ” -J-Dfile.encoding=ISO-8859-1 ”

    Thanks for the tip!

  15. Thanks for the tip. Finally my netbeans display the arabic characters correctly instead of gibberish. =)

  16. Muito bom! Minhas páginas xhtml (construídas no linux) não estavam aparecendo corretamente no windows porque o netbeans utilizava o encode do windows. (Se eu abrisse o mesmo arquivo no notepad++ ele abria corretamente, mas no netbeans não.)

    Valeu!

  17. Estava ficando descabelado por não conseguir configurar direito este IDE como os colegas, tentei todos os métedos. Depois de uma boa noite de sono – rs rs rs – finalmente descobri o problema. Meus projetos são gerenciados com o utilitário maven e no arquivo de configuração – pox.xml – tinha ajustado para um encoding que o IDE não gerenciava direito e não importava qualque mudança fizesse na configuração, o dito cujo não mudava.
    Foi aí que lembrei do ajuste que havia feito no arquivo pom.xml. Foi dito e feito, mudei para UTF-8 e pronto:
    maven-compiler-plugin

    1.5
    1.5
    UTF-8

  18. Great tip, i develop in PHP / CakePHP using NetBeans and this problem was killing me.

    Valeu!

  19. I did the same modification for NetBeans 6.9 on WinXp, but it doesn’t work. Any tips?

  20. my requirement is actually my filename is in japanese when i download the file the file name becomes garbled.i am using ruby-1.8.6 on windows.please help me
    thanks in advance

  21. Hello, and thank you for the tip. I also had troubles finding solution to the encoding problem.

    To the Netbeans team: please include this very basic functionality in the GUI!

  22. Thank you so much for the quick tip, worked perfectly and solved the problem once and 4ever (using win7 here btw) cheers!

  23. thanks!!!!!!!!!!!! great tip

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

    Leave a Reply

  25. Worked perfectly for me. THANKS!

  26. Thanks! That worked like a charm!

  27. thanks. I had been trying for over a week now to read japanese characters as input. this finally worked. thanks alot

  28. For those using OSX, the directory for the netbeans.conf is:
    /Applications/Netbeans [version].app/Contents//Resources/Netbeans/etc/netbeans.conf

    BTW it worked perfectly, thanks.

  29. I was happy to find this blog post, thinking it will solve my problem and I did add utf8 to the conf file as described BUT unfortunately only umlaute are displayed properly. Especially french characters only result in boxes like � . I am using windows xp pro sp3 (french version) and netbeans 6.9.

    Has anybody an idea what is the problem?

  30. Thank you very very much !!!

  31. thank you!

  32. Thank you! I work with files where comments were written in Korean. Due to UTF-8 issue, I abandoned Netbeans and start using Eclipse. Now I can go back to Netbeans.

  33. Works great on 7.2. Thanks

  34. It works. Thank you so much !

  35. “netbeans and UTF8 encoding ditoinfo in english” was a superb
    blog. If solely there was a lot more websites just like this excellent one
    in the online world. Anyhow, thank you for your personal precious time, Birgit

  36. ya helped me – thanks

  37. […] I browse on Internet I found the solution on someone blog , simple enough just […]

  38. thks man, just in case you can not edit netbeans.conf because of security restrictions, copy it in ‘desktop’ make the change and past it in the appropriate folder etc /
    Hope that help ;)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: