NetBeans, Ruby, Rails and the story of UTF8
I am a NetBeans user for about 4 years now. Although Eclipse is still my Number 1 IDE for Java, NetBeans is my only IDE for Ruby on Rails.
In my Ruby development I noticed that there are some problems with the encoding. First I thought that the problem was Ruby, but it wasn’t. Then I checked a couple of NetBeans settings. For example you can set the encoding in the project settings:

However, nothing helped. After some Google research I came across this blog entry. It says that NetBeans doesn’t use UTF 8 for file encoding by default! My first thought was “why not?”! So to recap this, the actual project setting is UTF8, but the file encoding isn’t! To enable UTF8 encoding for the files too, you have to:
- go the etc folder in the NetBeans directory
- open the netbeans.conf
- and add the following to the netbeans_default_options => -J-Dfile.encoding=UTF-8
After that everything works correctly and I can see the German Umlaute once again, in the file view and in the output window.
Related posts:
