@@ -125,8 +125,8 @@ private ClaudeCodeCliResult runProcess(String stdin, String... args) {
125125 int exitCode = environment == null
126126 ? executor .execute (cmd )
127127 : executor .execute (cmd , environment );
128- String out = stdout .toString ().trim ();
129- String err = stderr .toString ().trim ();
128+ String out = stdout .toString (java . nio . charset . StandardCharsets . UTF_8 ).trim ();
129+ String err = stderr .toString (java . nio . charset . StandardCharsets . UTF_8 ).trim ();
130130 log .debug ("claude CLI executed: exitCode={}, stdout.len={}" , exitCode , out .length ());
131131 if (watchdog .killedProcess ()) {
132132 return new ClaudeCodeCliResult (-1 , out , "claude CLI timed out after " + timeoutMs + " ms\n " + err );
@@ -139,8 +139,8 @@ private ClaudeCodeCliResult runProcess(String stdin, String... args) {
139139 // with the real exit code instead of discarding the output. The
140140 // deadline check makes the timeout verdict race-free even when
141141 // {@code watchdog.killedProcess()} has not observed the kill yet.
142- String out = stdout .toString ().trim ();
143- String err = stderr .toString ().trim ();
142+ String out = stdout .toString (java . nio . charset . StandardCharsets . UTF_8 ).trim ();
143+ String err = stderr .toString (java . nio . charset . StandardCharsets . UTF_8 ).trim ();
144144 boolean timedOut = watchdog .killedProcess ()
145145 || System .nanoTime () - startNanos >= timeoutMs * 1_000_000L ;
146146 if (timedOut ) {
0 commit comments