Open cawoodm opened 3 years ago
Apparently PowerShell is receiving ä
encoded as 5 bytes 226
148
156
195
and 177
!
ps.addCommand('$str="bär";echo $str; echo $([System.Text.Encoding]::UTF8.GetBytes($str))');
...
bär
98
226
148
156
195
177
114
@cawoodm Hi, do you have a solution or workaround for this problem yet? In the latest version, the problem is still present.
Nope, I gave up on this library 🤷♂️ and went for node-powershell
.
https://github.com/cawoodm/powowshell/blob/master/ide/package.json
@cawoodm I am using node-powershell v5.0.1. And I am not familiar with using profiles for PowerShell. But now I was able to solve my problem by removing noProfile from PS-Config. But I'm not sure that's a good idea.
Anyway, "Bär" is now displayed as a "Bär" and no longer as "B├ñr". :-)
It seems characters like
ä
orü
are incorrectly encoded in the resulting javascript string.PowerShell Script foo.ps1
Node-PowerShell
Result:
As you can see the buffer is mangled to
bär
:At the utils.js level we see the UTF-8 Replacement characters: