terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Add support for Russian characters for PowerShell within

Open SiarheiKuchukBelitsoft opened this issue 6 years ago • 10 comments

This is how it looks now if to type on Russian image

SiarheiKuchukBelitsoft avatar Mar 18 '20 09:03 SiarheiKuchukBelitsoft

it's a system-wide problem. Not a WT. You can see the same issue in your regular PowerShell console. The reason is: Your current code page in powershell likely is set to "437 (OEM - US)". To see normal Cyrillic characters it should be set for example to "866 (OEM - Rus)".

You can activate it for whole system in Classic Control Panel -> Region -> Administrative and set "Current language for non-Unicode programs" to "Russian" (or other Cyr language)

ertyz avatar Mar 18 '20 10:03 ertyz

@ertyz Thanks. I thought that you were using Unicode and stuff behind the scenes and those setting will go away

SiarheiKuchukBelitsoft avatar Mar 18 '20 10:03 SiarheiKuchukBelitsoft

@ertyz Can I ask you to just consider switching to Unicode by-default for PowerShell since it sounds like we have modern technologies with ASCII epoch

SiarheiKuchukBelitsoft avatar Mar 18 '20 10:03 SiarheiKuchukBelitsoft

@SiarheiKuchukBelitsoft That might be a request that's better suited for the Powershell repo, powershell/powershell. I'd think that the newer versions of powershell might just handle this better already. The one that's pre-installed on Windows is Powershell 5, and Powershell 7 was just released

zadjii-msft avatar Mar 18 '20 12:03 zadjii-msft

@zadjii-msft Thanks for your input! @ertyz, Thanks for so fast response!

SiarheiKuchukBelitsoft avatar Mar 18 '20 12:03 SiarheiKuchukBelitsoft

I've just checked, Powershell 7 indeed works with Unicode out of the box!

SiarheiKuchukBelitsoft avatar Mar 18 '20 12:03 SiarheiKuchukBelitsoft

[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")

image

Aliaksandr3by avatar Jan 08 '21 03:01 Aliaksandr3by

[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")

@Aliaksandr3by - Cool! Seems to work in terminal as well: image

Don-Vito avatar Jan 08 '21 07:01 Don-Vito

@Aliaksandr3by It would be better if that it will enabled by default

drweb86 avatar Jan 11 '21 09:01 drweb86

@Aliaksandr3by It would be better if that it will enabled by default

I use pwsh7 https://github.com/PowerShell/PowerShell

You might use

%windir%\system32\WindowsPowerShell\v1.0 and to create either file: notepad $pshome\profile.ps1 or notepad $pshome\Microsoft.PowerShell_profile.ps1 image

Aliaksandr3by avatar Jan 11 '21 09:01 Aliaksandr3by