i have simple console program in java, i try to get input from user the input is in Hebrew "שלום" but when i tried to read it i get ???? , but i wish to get "שלום" , how is the best way?
my code:
public static void main(String[] args) {
String s;
Scanner in = new Scanner(System.in);
System.out.println("Enter a string");
s = in.nextLine();
System.out.println(s);
}
}
output:
run:
Enter a string
שלום
????
BUILD SUCCESSFUL (total time: 5 seconds)
i know that i should use utf-8 but i really dont know how... any help?