在maven项目中用扫描仪输入阿拉伯字符
input arabic characters with scanner in maven project
我在 netbeans 8.2 上工作,我创建了一个 java maven 项目,我只想输入一个阿拉伯字符并显示它,但不能正常工作:
Scanner sc = new Scanner(System.in);
System.out.print("enter arabic word = ");
String p = sc.nextLine() ; // input = ياسين
System.out.println("here is your word = " + p); //output = J'3JF
注意:我已经更改了 netbeans 配置 (/etc/netbeans.conf) 以接受 UTF-8 编码,但我在 MAVEN 项目中遇到了这个问题。
尝试在其他环境中运行编码。可能 NetBeans 不支持 UTF-8。
旧的但可能仍然是实际的文章:https://www.google.com/amp/s/ditoinfo.wordpress.com/2007/02/26/netbeans-and-utf8-encoding-2/amp/?espv=1
我在 netbeans 8.2 上工作,我创建了一个 java maven 项目,我只想输入一个阿拉伯字符并显示它,但不能正常工作:
Scanner sc = new Scanner(System.in);
System.out.print("enter arabic word = ");
String p = sc.nextLine() ; // input = ياسين
System.out.println("here is your word = " + p); //output = J'3JF
注意:我已经更改了 netbeans 配置 (/etc/netbeans.conf) 以接受 UTF-8 编码,但我在 MAVEN 项目中遇到了这个问题。
尝试在其他环境中运行编码。可能 NetBeans 不支持 UTF-8。
旧的但可能仍然是实际的文章:https://www.google.com/amp/s/ditoinfo.wordpress.com/2007/02/26/netbeans-and-utf8-encoding-2/amp/?espv=1