NetBeans IDE出现中文成乱码?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NetBeans IDE出现中文成乱码?相关的知识,希望对你有一定的参考价值。
请问下各位为什么我的NetBeans IDE 6.9.1出现中文成乱码?6.7也是这样,如图所示!希望各位能帮帮忙,谢谢!
在netbeans_default_options后面增加-J-Dfile.encoding=UTF-8也是不行的!
2. 用记事本打开netbeans.conf
3. 找到netbeans_default_options这一句
4. 在最后面加上一个空格,再加入-J-Dfile.encoding=UTF-8
例如:
Ruby代码 <embed type="application/x-shockwave-flash" width="14" height="15" src="/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=netbeans_default_options%3D%22-J-client%20-J-Xss2m%20-J-Xms32m%20-J-XX%3APermSize%3D32m%20-J-XX%3AMaxPermSize%3D200m%20-J-Xverify%3Anone%20-J-Dapple.laf.useScreenMenuBar%3Dtrue%20-J-Dsun.java2d.noddraw%3Dtrue%20-J-Dfile.encoding%3DUTF-8%22" quality="high" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
netbeans_default_options= "-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dfile.encoding=UTF-8"
这样,打开的所有文件都用UTF-8解码了,不会再出现乱码的情况。 参考技术A 是怎么解决的?
netbeans中文显示为乱码怎么办
参考技术A 在Netbeans8.0上开发php,设置字体为Consola后,发现中文显示是乱码的,经过修改jre的配置文件成功解决了这个问题。1.
进入jdk安装目录下/jre/lib文件夹,找到fontconfig.properties.src,拷贝为
fontconfig.properties
,修改此文件。
找到:
sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb
monospaced.plain.alphabetic=Courier
New
monospaced.bold.alphabetic=Courier
New
Bold
monospaced.bolditalic.alphabetic=Courier
New
Italic
monospaced.bolditalic.alphabetic=Courier
New
Bold
Italic
修改为:
sequence.monospaced.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
monospaced.plain.alphabetic=Consolas
monospaced.bold.alphabetic=Consolas
Bold
monospaced.bolditalic.alphabetic=Consolas
Italic
monospaced.bolditalic.alphabetic=Consolas
Bold
Italic
在文件末尾添加Consola字体定义:
filename.Consolas=CONSOLA.TTF
filename.Consolas_Bold=CONSOLAB.TTF
filename.Consolas_Italic=CONSOLAI.TTF
filename.Consolas_Bold_Italic=CONSOLAZ.TTF
2.
在Netbeans中进行配置
Netbeans->工具->选项->字体和颜色
字体设置为
Monospaced
。
设置成功。其他字体的设置将Consola设为其他字体即可。
以上是关于NetBeans IDE出现中文成乱码?的主要内容,如果未能解决你的问题,请参考以下文章
win7下netbeans6.9.1为啥会乱码?怎样解决?向各位大神求助。