官方就有解决方法,这招可以解决目前所有的版本,全部文件将用UTF-8解码.
这是原文:
For those who need to use international and multibyte characters, NetBeans can support UTF-8 editing. To enable it, go to your NetBeans installation directory and find the etc folder. There will be a file there called netbeans.conf .
This file keeps some configuration for NetBeans, including the default command line arguments. These are parameters that will be sent to a new starting Netbeans IDE.
Every argument lives inside a double-quoted variable called netbeans_default_options , and each one is separated from another by a space.
To enable UTF-8 in NetBeans, just place this parameter anywhere on the list of netbeans_default_options:-J-Dfile.encoding=UTF-8
中文解释:
1.找到你的Netbeans安装目录下的etc文件夹,如C:Program FilesNetBeans 6.0 M9etc
2.用记事本打开netbeans.conf
3.找到netbeans_default_options这一句(没带#号的,带#号的是注释)
4.在最后面加上一个空格,再加入-J-Dfile.encoding=UTF-8
如我现在的设置:
这样,打开的文件所有都用UTF-8解码了~哈哈,不再有乱码咯~