@@ -143,8 +143,8 @@ private CodexCliResult runProcess(String stdin, String... args) {
143143 long startNanos = System .nanoTime ();
144144 try {
145145 int exitCode = executor .execute (cmd );
146- String out = stdout .toString ().trim ();
147- String err = stderr .toString ().trim ();
146+ String out = stdout .toString (StandardCharsets . UTF_8 ).trim ();
147+ String err = stderr .toString (StandardCharsets . UTF_8 ).trim ();
148148 log .debug ("codex CLI executed: exitCode={}, stdout.len={}" , exitCode , out .length ());
149149 if (watchdog .killedProcess ()) {
150150 return new CodexCliResult (-1 , out , "codex CLI timed out after " + timeoutMs + " ms\n " + err );
@@ -157,8 +157,8 @@ private CodexCliResult runProcess(String stdin, String... args) {
157157 // with the real exit code instead of discarding the output. The
158158 // deadline check makes the timeout verdict race-free even when
159159 // {@code watchdog.killedProcess()} has not observed the kill yet.
160- String out = stdout .toString ().trim ();
161- String err = stderr .toString ().trim ();
160+ String out = stdout .toString (StandardCharsets . UTF_8 ).trim ();
161+ String err = stderr .toString (StandardCharsets . UTF_8 ).trim ();
162162 boolean timedOut = watchdog .killedProcess ()
163163 || System .nanoTime () - startNanos >= timeoutMs * 1_000_000L ;
164164 if (timedOut ) {
0 commit comments