@@ -180,8 +180,8 @@ private ComfyCliResult runProcess(String stdin, String... args) {
180180 long startNanos = System .nanoTime ();
181181 try {
182182 int exitCode = childEnv == null ? executor .execute (cmd ) : executor .execute (cmd , childEnv );
183- String out = stdout .toString ().trim ();
184- String err = stderr .toString ().trim ();
183+ String out = stdout .toString (StandardCharsets . UTF_8 ).trim ();
184+ String err = stderr .toString (StandardCharsets . UTF_8 ).trim ();
185185 log .debug ("comfy CLI executed: exitCode={}, stdout.len={}" , exitCode , out .length ());
186186 if (watchdog .killedProcess ()) {
187187 return new ComfyCliResult (-1 , out , "comfy CLI timed out after " + timeoutMs + " ms\n " + err );
@@ -194,8 +194,8 @@ private ComfyCliResult runProcess(String stdin, String... args) {
194194 // with the real exit code instead of discarding the output. The
195195 // deadline check makes the timeout verdict race-free even when
196196 // {@code watchdog.killedProcess()} has not observed the kill yet.
197- String out = stdout .toString ().trim ();
198- String err = stderr .toString ().trim ();
197+ String out = stdout .toString (StandardCharsets . UTF_8 ).trim ();
198+ String err = stderr .toString (StandardCharsets . UTF_8 ).trim ();
199199 boolean timedOut = watchdog .killedProcess ()
200200 || System .nanoTime () - startNanos >= timeoutMs * 1_000_000L ;
201201 if (timedOut ) {
0 commit comments