如何在Netbeans 7,8中显示UTF8?

时间:2011-05-07 17:34:53

标签: netbeans netbeans-7 utf

在我的java项目中,我需要使用阿拉伯语文本和字符串,但文本变得像"???????",那么错误是什么?以及如何解决这个问题?

感谢

4 个答案:

答案 0 :(得分:35)

您可以使用启动选项设置Netbeans 将其放在netbeans.conf

中的netbeans_default_options

-J-Dfile.encoding=UTF-8

最后看起来应该是

netbeans_default_options="..... -J-Dfile.encoding=UTF-8"

希望它能帮到你

答案 1 :(得分:3)

以下是将Netbeans中的默认字符集设置为UTF-8(在Windows中)的说明:

1 Go to C:\Program Files\netbeans-x.x\etc
2 Open netbeans.conf in Notepad.
3 On the netbeans_default_options add: -J-Dfile.encoding=UTF-8. (make sure to put it within the quotation marks)
4 Project properties -> Build -> Compiling ->

    Additional compiler options) text box.- add: -encoding UTF-8 

5 You can also check to make sure that you have increased the memory allocation for Netbeans by looking at the netbeans_default_options line. The default max is 128MB. We have increased this to 256MB. 

答案 2 :(得分:3)

Ubuntu go目录 恩。

  

sudo gedit /usr/local/netbeans-8.0/etc/netbeans.conf

添加

  

netbeans_default_options =" -J-指定-Dfile.encoding = UTF-8"

保存Fin

答案 3 :(得分:1)

请遵循以下问题,以解决如何在Netbeans中对UTF 8 Dari,Pashto,波斯和阿拉伯语提供支持

  1. 打开C:\ Program Files \ NetBeans 8.0.2 \ etc PAT窗体窗口
  2. 而不是将netbeans.conf复制到计算机中的某个位置
  3. 在netbeans_default_options =内添加-J-Dfile.encoding = UTF-8
  4. 类似下面的代码
  5. netbeans_default_options =“-J-Dfile.encoding = UTF-8 -J-client -J-Xss2m -J-Xms32m -J- XX:PermSize = 32m -J-Dapple.laf.useScreenMenuBar = true -J-Dapple .awt.graphics.UseQuartz = true -J-Dsun.java2d.noddraw = true -J-Dsun.java2d.dpiaware = true -J-Dsun.zip.disableMemoryMapping = true“
  6. 而不是将文件替换为C:\ Program Files \ NetBeans 8.0.2 \ etc
  7. 现在关闭netbeans并重新打开它,这样它就可以使用所有语言,例如Dari,Pashto,波斯语,阿拉伯语等等。