[commit: process] encoding: Set CREATE_UNICODE_ENVIRONMENT when doing CreateProcess (6174b85)

Max Bolingbroke batterseapower at hotmail.com
Wed Apr 6 16:37:22 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/packages/process

On branch  : encoding

http://hackage.haskell.org/trac/ghc/changeset/6174b851592a6fde456d94f0c5ecc1d95d8bde81

>---------------------------------------------------------------

commit 6174b851592a6fde456d94f0c5ecc1d95d8bde81
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date:   Wed Apr 6 13:46:27 2011 +0100

    Set CREATE_UNICODE_ENVIRONMENT when doing CreateProcess

>---------------------------------------------------------------

 cbits/runProcess.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cbits/runProcess.c b/cbits/runProcess.c
index 1b74d68..7ccc2ba 100644
--- a/cbits/runProcess.c
+++ b/cbits/runProcess.c
@@ -430,12 +430,12 @@ runInteractiveProcess (wchar_t *cmd, wchar_t *workingDirectory,
             sInfo.hStdError = hStdErrorWrite;
         }
 
+    // We always pass a wide environment block, so we MUST set this flag 
+    flags = CREATE_UNICODE_ENVIRONMENT;
 	if (sInfo.hStdInput  != GetStdHandle(STD_INPUT_HANDLE)  &&
 	    sInfo.hStdOutput != GetStdHandle(STD_OUTPUT_HANDLE) &&
 	    sInfo.hStdError  != GetStdHandle(STD_ERROR_HANDLE))
-		flags = CREATE_NO_WINDOW;   // Run without console window only when both output and error are redirected
-	else
-		flags = 0;
+		flags = flags | CREATE_NO_WINDOW;   // Run without console window only when both output and error are redirected
 
         // See #3231
         if (close_fds && fdStdIn == 0 && fdStdOut == 1 && fdStdErr == 2) {





More information about the Cvs-libraries mailing list