Does anyone know what encoding can be used to send commands to the terminal via a pipe created by the CreatePipe method? Commands with Cyrillic, Russian or Chinese characters must be sent to the terminal. The terminal is created by the CreateProcessW method. Characters are sent to the pipe in UTF-8 encoding. I can't understand why when using UTF-8 encoding the commands in the terminal are displayed correctly, but when executing the command the characters are displayed incorrectly.
PS C:\Users\Forty\AppData\Roaming\TerminalsThisWay> chcp 65001
Active code page: 65001
PS C:\Users\Forty\AppData\Roaming\TerminalsThisWay> cd "D:\Кухонный дед"
cd : Cannot find path 'D:\╨Ъ╤Г╤Е╨╛╨╜╨╜╤Л╨╣ ╨┤╨╡╨┤' because it does not exist.
At line:1 char:1
+ cd "D:\╨Ъ╤Г╤Е╨╛╨╜╨╜╤Л╨╣ ╨┤╨╡╨┤"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (D:\╨Ъ╤Г╤Е╨╛╨╜╨╜╤Л╨╣ ╨┤╨╡╨┤:String) [Set-Location], ItemNotFoundExceptio
n
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
PS C:\Users\Forty\AppData\Roaming\TerminalsThisWay> cd "D:\错误写入通道"
cd : Cannot find path 'D:\щФЩшппхЖЩхЕещАЪщБУ' because it does not exist.
At line:1 char:1
+ cd "D:\щФЩшппхЖЩхЕещАЪщБУ"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (D:\щФЩшппхЖЩхЕещАЪщБУ:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
When you're using PowerShell to enter the command, it's in utf-16 cause that's what PowerShell uses by default, cmd uses utf-8, so either run cmd or run a few commands to make PowerShell use utf-8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With