My program:
public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.println("In: ");
String line = scanner.nextLine();
System.out.println("Out: " + line);
}
}
}
and this is what happens in the terminal:
F:VisualStudioProjectsgomin1d-privatbank> cmd /C ""C:Program FilesJavajdk-17binjava.exe" @C:Usersgomin1dAppDataLocalTempcp_1lcwykhiu05r4mk6dzfx3j0td.argfile fun.gomin1d.privatbank.Test "
In:
test
Out: test
In:
тест
Out: ???
how to fix it?
If I apply the command chcp 65001 then there will be spaces instead of ???:
F:VisualStudioProjectsgomin1d-privatbank>chcp 65001
Active code page: 65001
F:VisualStudioProjectsgomin1d-privatbank> cmd /C ""C:Program FilesJavajdk-17binjava.exe" @C:Usersgomin1dAppDataLocalTempcp_1lcwykhiu05r4mk6dzfx3j0td.argfile fun.gomin1d.privatbank.Test "
In:
test
Out: test
In:
тест
Out:
1