20

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

谢谢

4

4 回答 4

35

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

-J-Dfile.encoding=UTF-8

最后它应该看起来像

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

希望它会帮助你

于 2011-05-07T17:45:28.563 回答
3

Ubuntu go 目录前。

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

添加

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

保存鳍

于 2014-05-30T11:37:49.830 回答
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. 
于 2014-05-14T05:04:07.170 回答
1

请按照以下问题解决如何在 Netbeans 中支持 UTF 8 达里语、普什图语、波斯语和阿拉伯语

  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 并重新打开它,这样它就可以使用所有语言,如达里语、普什图语、波斯语、阿拉伯语等......
于 2019-05-16T07:27:08.537 回答