From b0709e68b3e6b5eef94d5af604b700fcdcfaa812 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Tue, 20 Apr 2021 21:32:56 +0200 Subject: [PATCH] fix(pwsh): force module to UTF8 resolves #670 --- packages/powershell/oh-my-posh/oh-my-posh.psm1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 4a98de46c5bb..95b0cdf25973 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -3,6 +3,10 @@ Generates the prompt before each line in the console #> +# Powershell doesn't default to UTF8 just yet, so we're forcing it as there are too many problems +# that pop up when we don't +[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding + function Get-PoshCommand { if ($IsMacOS) { return "$PSScriptRoot/bin/posh-darwin-amd64"