From: Chris Hanson Date: Fri, 19 Jul 2019 03:26:56 +0000 (-0400) Subject: Edwin: force subprocess I/O ports to use iso-8859-1 coding. X-Git-Tag: mit-scheme-pucked-10.1.12~7^2~7 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=08e4e43e2f1f6a31a3f22ea19f51bb347e211f20;p=mit-scheme.git 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. --- 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