From 08e4e43e2f1f6a31a3f22ea19f51bb347e211f20 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 18 Jul 2019 23:26:56 -0400 Subject: [PATCH] Edwin: force subprocess I/O ports to use iso-8859-1 coding. There may still be a problem with synchronous subprocesses, since we don't have a way to get at those ports. If the process writes UTF-8, then the I/O copier will try to write unicode chars to a buffer, and I'm not sure what will happen in that case. It might just ignore the upper bits. --- src/edwin/process.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/edwin/process.scm b/src/edwin/process.scm index 1c2d8f835..71d0fe7b0 100644 --- a/src/edwin/process.scm +++ b/src/edwin/process.scm @@ -159,6 +159,12 @@ Initialized from the SHELL environment variable." (let ((channel (subprocess-input-channel subprocess))) (if channel (channel-nonblocking channel))) + (let ((fix-port + (lambda (port) + (if (and port (port/supports-coding? port)) + (port/set-coding port 'iso-8859-1))))) + (fix-port (subprocess-input-port subprocess)) + (fix-port (subprocess-output-port subprocess))) (set-process-status-registration! process (register-subprocess-event -- 2.25.1