From 2d63a45a8ab2479234856434c6ab5549b8880017 Mon Sep 17 00:00:00 2001 From: Juergen Hoetzel Date: Sun, 10 Apr 2016 13:09:34 +0200 Subject: [PATCH] Use UTF-8 encoding for process output on Mono Fixes encoding issus on systems when encoding property is not set. --- src/app/FakeLib/ProcessHelper.fs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/FakeLib/ProcessHelper.fs b/src/app/FakeLib/ProcessHelper.fs index 28b348a3d67..0dc3b06bb93 100644 --- a/src/app/FakeLib/ProcessHelper.fs +++ b/src/app/FakeLib/ProcessHelper.fs @@ -7,6 +7,7 @@ open System.ComponentModel open System.Diagnostics open System.IO open System.Threading +open System.Text open System.Collections.Generic open System.ServiceProcess @@ -15,9 +16,12 @@ let startedProcesses = HashSet() /// [omit] let start (proc : Process) = - if isMono && proc.StartInfo.FileName.ToLowerInvariant().EndsWith(".exe") then - proc.StartInfo.Arguments <- "--debug \"" + proc.StartInfo.FileName + "\" " + proc.StartInfo.Arguments - proc.StartInfo.FileName <- monoPath + if isMono then + proc.StartInfo.StandardOutputEncoding <- Encoding.UTF8 + proc.StartInfo.StandardErrorEncoding <- Encoding.UTF8 + if proc.StartInfo.FileName.ToLowerInvariant().EndsWith(".exe") then + proc.StartInfo.Arguments <- "--debug \"" + proc.StartInfo.FileName + "\" " + proc.StartInfo.Arguments + proc.StartInfo.FileName <- monoPath proc.Start() |> ignore startedProcesses.Add(proc.Id, proc.StartTime) |> ignore