#[SOLVED] Problem displaying unicode powershell

4 messages · Page 1 of 1 (latest)

dry moat
#

Hiya! I'm trying to make my own Powershell prompt.

For some reason I cannot seem to make unicode appear in the prompt.

Currently I have:

fastfetch

fastfetch
$time = $(get-date -f "HH:mm")
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
$PSDefaultParameterValues['Get-Content:Encoding'] = 'utf8'
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::Unicode
function Prompt {
  "$Env:UserName $(Get-Location) ►"
}
}```

Bare in mind I am using neovim to edit the file. 

The weird thing is, when the function is run within the terminal, it's fine, it displays the unicode. 
However when it's saved within the ps1 file, it looks like this:
```stell C:\Users\stell â–º```

(I am trying to avoid using Oh My Posh)
When it's run through the terminal(Wtf):
#

I read somewhere that it could be something to do with how the file is being saved? Very strange indeed. Could it be that neovim isn't saving the files as utf-8?

#

Opened in code, UTF-8

dry moat