From 53ce291074f47b21261498bae95982f378fe0b73 Mon Sep 17 00:00:00 2001 From: Ilja Nosik Date: Mon, 12 Jun 2017 15:39:24 +0200 Subject: [PATCH] Restore console encoding on .NET Framework PR #1580 didn't restore the previous encoding but the value from `Fake.EnvironmentHelper.encoding`. --- src/app/FAKE/Program.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/FAKE/Program.fs b/src/app/FAKE/Program.fs index 11e87bde62b..eca6828170d 100644 --- a/src/app/FAKE/Program.fs +++ b/src/app/FAKE/Program.fs @@ -37,8 +37,8 @@ let paramIsHelp param = containsParam param ["help"; "?"; "/?"; "-h"; "--help"; let buildScripts = !! "*.fsx" |> Seq.toList +let encodingToRestore = Console.OutputEncoding try - let encoding = Console.OutputEncoding try AutoCloseXmlWriter <- true @@ -167,6 +167,6 @@ try finally traceEndBuild() - Console.OutputEncoding <- encoding + Console.OutputEncoding <- encodingToRestore if !TargetHelper.ExitCode.exitCode <> 0 then exit !TargetHelper.ExitCode.exitCode if Environment.ExitCode <> 0 then exit Environment.ExitCode \ No newline at end of file