问题描述
我有这个简单的代码,可以打印阿拉伯语句子并扫描阿拉伯字符.
I have this simple code that prints Arabic sentence and scan arabic characters .
让我发疯的是它在 cmd 中正确打印,但从不扫描字符,它以
what is drivingme crazy is that it prints in cmd right , but never scan characters it scans arabic characters in form of
我什么都试过了:Scanner(System.in,"UTF-8")
, Scanner(System.in,"UTF8");
请帮忙
public static void main(String[] args) {
Scanner in2 = new Scanner(System.in,"UTF-8");
System.out.printf(" ادخل جملة السؤال \n");
String s = in2.nextLine();
System.out.printf(""+s+"");
// TODO code application logic here
} Scanner in2 = new Scanner(System.in,"UTF-8");
System.out.printf(" ادخل جملة السؤال \n");
String s = in2.nextLine();
System.out.printf(""+s+"");
输出:
ادخل جملة السؤال هذا تلميذ
构建成功(总时间:11 秒)
BUILD SUCCESSFUL (total time: 11 seconds)
推荐答案
我在 netbeans 8 和 windows 7 上有同样的问题
要解决这个问题,请这样做
打开
i have the same problem with netbeans 8 and windows 7
to fix this please do that
open
C:\Program Files\NetBeans 8.0\etc\netbeans.conf
你会发现这个
netbeans_default_options="..."
在它的开头添加这段代码,最后它看起来像那样
add this code at the begining of it so at the end it will look like that
netbeans_default_options="-J-Dfile.encoding=UTF-8 -J-client ..."
并重新启动netbeans
and restart the netbeans
检查这个屏幕截图
这篇关于扫描阿拉伯字符 netbeans 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!