Character encoding is broken in prompt function, but not when I call oh-my-posh directly.
Prompt doesn't render icons, but if you run oh-my-posh directly with the same config it renders as expected.

Prompt function script:
[ScriptBlock]$Prompt = {
$realLASTEXITCODE = $global:LASTEXITCODE
if ([string]::IsNullOrEmpty($realLASTEXITCODE) ) { $realLASTEXITCODE = 0 }
& oh-my-posh -config C:\Users\chunt\.ohmyposh.json -error $realLASTEXITCODE -pwd $PWD.Path
$global:LASTEXITCODE = $realLASTEXITCODE
Remove-Variable realLASTEXITCODE -Confirm:$false
}
Set-Item -Path Function:\prompt -Value $Prompt -Force
}
Try adding
[console]::OutputEncoding = New-Object System.Text.UTF8Encoding
before your [ScriptBlock]
@nwykes is right, the encoding in the prompt function is different (respects the code page set by Powershell rather than the executable). The PowerShell module adds this for you, I'll update the docs with that context too.
I thought Powershell finally standardized on UTF8. Anyway, that worked. Thanks!
Most helpful comment
Try adding
before your [ScriptBlock]