Home > netbeans, programming, rails, ruby > netbeans and UTF8 encoding

netbeans and UTF8 encoding

[digg=http://www.digg.com/programming/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

Categories: netbeans, programming, rails, ruby Tags:
  1. James Branam
    February 26th, 2007 at 16:20 | #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. February 26th, 2007 at 16:51 | #2

    Hi James,

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

  3. justNeedHelp
    March 25th, 2007 at 20:50 | #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. ahoge
    March 18th, 2008 at 09:00 | #4

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

  5. LM
    April 21st, 2008 at 10:34 | #5

    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…

  6. July 16th, 2008 at 16:58 | #6

    Thanks! That solved a lot of issues.

  7. September 10th, 2008 at 07:01 | #7

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

  8. M
    October 14th, 2008 at 20:53 | #8

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

  9. October 16th, 2008 at 03:06 | #9

    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?

  10. Heródoto
    December 20th, 2008 at 00:28 | #10

    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?

  11. December 25th, 2008 at 19:20 | #11

    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)

  1. April 9th, 2007 at 15:35 | #1