From e14925d366a3d03592710070b3668d96487448cb Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 24 Jan 2017 16:38:35 -0800 Subject: [PATCH] Fix Encoding for PowerShell script (#7625) fixes #7623 --- bin/flutter.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/flutter.ps1 b/bin/flutter.ps1 index f7f312b1e6..a3f2940c17 100644 --- a/bin/flutter.ps1 +++ b/bin/flutter.ps1 @@ -60,6 +60,10 @@ if (!(Test-Path $snapshotPath) ` $revision | Out-File $stampPath } +# Switch PowerShell to UTF8 encoding for Dart. +$encoding = [Console]::OutputEncoding +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + Invoke-Expression "$dart `"$snapshotPath`" $args" # The VM exits with code 253 if the snapshot version is out-of-date. @@ -67,3 +71,6 @@ if ($LASTEXITCODE -eq 253) { Invoke-Expression "$dart --snapshot=`"$snapshotPath`" `"$scriptPath`" --packages=`"$flutterToolsDir\.packages`"" Invoke-Expression "$dart `"$snapshotPath`" $args" } + +# Reset PowerShell to whatever the user's encoding was. +[Console]::OutputEncoding = $encoding