'java encoding charset doesn't work in .bat file

I am using turkish charset in intellij idea when i read input from console like this.

String CHARSET_NAME="windows-1254";
Scanner in1 = new Scanner(System.in,CHARSET_NAME);
String s1 = in1.nextLine();

it is simple console application. After i export jar and try to run in .bat file. I can't read turkish chars. enter image description here

this is my .bat file

cd C:\Users\Altan\Desktop\untitled_jar
chcp 1254
java -jar untitled.jar
pause

By the way there is no problem as i running in intellij idea



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source