Skip to content

input arabic characters with scanner in maven project

i work on netbeans 8.2 and i create a java maven project, i want just take an input with arabic characters and display it and that don’t work properly :

Scanner sc = new Scanner(;
    System.out.print("enter arabic word = ");
    String p = sc.nextLine() ; // input = ياسين
    System.out.println("here is your word =  " + p); //output = J'3JF

NOTES: i have already change netbeans configuration (/etc/netbeans.conf) to accept UTF-8 encoding but i have this probleme just with MAVEN projects.



Try to run code in other environment. May NetBeans doesn’t support UTF-8.
Old but may still actual article:

6 People found this is helpful