I have this simple code that prints Arabic sentence and scan arabic characters .
what is drivingme crazy is that it prints in cmd right , but never scan characters it scans arabic characters in form of
��� �����
I tried everything: Scanner(System.in,"UTF-8")
, Scanner(System.in,"UTF8");
please help
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+"");
output :
ادخل جملة السؤال هذا تلميذ ��� �����
BUILD SUCCESSFUL (total time: 11 seconds)
Don't worry about that, it is the IDE's problem. Most IDEs console window don't support other that ASCII, but In real life Swing, this will appear as usual.
i have the same problem with netbeans 8 and windows 7
to fix this please do that
open
you will find this
add this code at the begining of it so at the end it will look like that
and restart the netbeans
check this screen shot
I faced this issue in Windows Server 2016.
Solution: 1. Go to Control Panel -> Region. 2. Open Administrative tab. 3. Click “Change System Local” to Arabic. 4. Restart the server.