This question has already been answered:

I work in NetBeans

When I assign a value to a String variable in Russian, in the output window, instead of this value, the question marks are shown: input: Russ output: ????

I changed the encoding from UTF-8 to windows-1251, but nothing has changed

вот код Scanner input = new Scanner(System.in); System.out.print("ввод "); String s1 = input.nextLine(); System.out.print("\nВывод "+s1); 

Just do not offer the code, because I have many other programs, and this is an example.

Reported as a duplicate by members Denis , pavel , dirkgntly , Dmitriy Simushev , Nicolas Chabanovsky Aug 26 '16 at 5:47 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

1 answer 1

If changing the encoding of the project did not help, try changing the encoding of the entered characters immediately:

 public static void main(String[] args) throws UnsupportedEncodingException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in,"Cp1251")); System.out.println("Ввод:"); String s = br.readLine(); System.out.println(s); }