@@ -168,8 +168,10 @@ private KimiCliResult runProcess(String stdin, String... args) {
168168 long startNanos = System .nanoTime ();
169169 try {
170170 int exitCode = executor .execute (cmd );
171- String out = stdout .toString ().trim ();
172- String err = stderr .toString ().trim ();
171+ // The CLI emits UTF-8; decoding with the platform default charset
172+ // corrupts non-ASCII output on C-locale environments.
173+ String out = stdout .toString (StandardCharsets .UTF_8 ).trim ();
174+ String err = stderr .toString (StandardCharsets .UTF_8 ).trim ();
173175 log .debug ("kimi CLI executed: exitCode={}, stdout.len={}" , exitCode , out .length ());
174176 if (watchdog .killedProcess ()) {
175177 return new KimiCliResult (-1 , out , "kimi CLI timed out after " + timeoutMs + " ms\n " + err );
@@ -182,8 +184,8 @@ private KimiCliResult runProcess(String stdin, String... args) {
182184 // with the real exit code instead of discarding the output. The
183185 // deadline check makes the timeout verdict race-free even when
184186 // {@code watchdog.killedProcess()} has not observed the kill yet.
185- String out = stdout .toString ().trim ();
186- String err = stderr .toString ().trim ();
187+ String out = stdout .toString (StandardCharsets . UTF_8 ).trim ();
188+ String err = stderr .toString (StandardCharsets . UTF_8 ).trim ();
187189 boolean timedOut = watchdog .killedProcess ()
188190 || System .nanoTime () - startNanos >= timeoutMs * 1_000_000L ;
189191 if (timedOut ) {
0 commit comments