Set CodePage สำหรับการใช้ Unicode บน Windows
Posted: 22 Jun 2023, 16:10
cmd shell
set console codepage จาก java
inheritIO() causes the child process to inherit the parent's stdout. When chcp modifies the character encoding of the child stdout it actually ends up modifying the parent's encoding as well. Great success!
Code: Select all
chcp 65001
Code: Select all
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/c", "chcp", "65001").inheritIO();
Process p = pb.start();
p.waitFor();