I mentioned that NetBeans 5.x uses the platform encoding by default at storing source files and now it has been changed, NetBeans 6.0 uses UTF-8 as default encoding.
  • What will happen when you open NetBeans 5.x project on NetBeans 6.0?
I haven't found any specification about this on NetBeans site yet, but as you may notice on NetBeans 6.0 Beta 1, NetBeans 6.0 opens the 5.x project by using platform encoding of NetBeans 6.0.

For example, the default encoding of Japanese Windows is Windows-31J. So in most cases when you enter Japanese characters into java source codes by using NetBeans 5.x, these have been stored as Windows-31J, not UTF-8. NetBeans 6.0 will open the project by using Windows-31J when you use Windows.



If you're opening 5.5.1 project on Windows, it sets to Windows-31j.

NetBeans 5.5.1 project does not have any information of encoding in it. NetBeans does not have any auto detection about the encoding, it will just use platform encoding. It can not work perfectly for all cases, but I think it's realistic approach because most users continue to use the same platform and encoding.

As you can imagine, the following case will not work.

1. You made NetBeans 5.5.1 project on Japanese Windows
2. Start NetBeans 6.0 in Solaris Japanese EUC locale
3. Open the project

NetBeans 6.0 will open the project by using EUC encoding in this case, because NetBeans is running in EUC locale. To fix the problem, you can change the encoding to the original encoding, Windows-31J on properties dialog.
Comments:

Little offtopic

What theme do you use with netbeans?
I guess this is yet to be released nimbus theme, right?

Posted by Vano Beridze on October 02, 2007 at 06:15 PM JST #

Yes, I'm using Nimbus but it's from Solaris Desktop. As you may know, NetBeans with Java6u1 is using the native desktop theme of GTK and the default theme of Solaris is now Nimbus. I tried Nimbus of https://nimbus.dev.java.net/ with NetBeans, but it could not start by some exceptions :-(

Posted by Masaki on October 02, 2007 at 06:39 PM JST #

Nice, but I've noticed a little problem with resource bundle files. For example, I am currently working in a UTF-8 encoded project. The matter is, when I open the messages.properties file in the editor, NetBeans 6.0 shows the file in the standard system encoding (ISO-8859-15), but it is edited in UTF-8. I have changed the project encoding to UTF-8 but, as the .properties is not a xml-like file, I have no way to change file encoding with a header like <?xml version="x.x" encoding="UTF-8" ?>. Any ideas? Thank you in advance.

Posted by Tony Gaze on January 31, 2008 at 10:21 PM JST #

Hi Tony, thanks for comment. .properties file does not follow the setting. As you know, .properties file should be saved as unicode ascii, not native encoding. When you edit it on Editor, the unicode ascii will be converted to native encoding automatically on NetBeans 6.0. So you can edit the contents with your language. When it's stored, it will be converted to unicode ascii automatically. See more detail about property editing, I posted one entry in English - http://blogs.sun.com/katakai/entry/editing_properties_files_on_netbeans

Posted by Masaki on February 01, 2008 at 12:25 AM JST #

Post a Comment:
Comments are closed for this entry.

This blog copyright 2009 by katakai