Certain French characters(e.g. ç) are getting replaced in CMD output for a power shell script

49 Views Asked by At

I am trying to execute a PowerShell script in CMD/PowerShell Prompt.

Please find my PS Script below:

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$name= "François Remetter"
write-host $name

But in CMD and PowerShell Prompt output ç is getting replaced by ç.

I am getting the below output:

D:\Codes\PSScripts>powershell exec.ps1
François Remetter

I tried to change the code page to 1252 and 65001.

But still I am getting the same wrong output.

Can someone please help me to resolve the issue ?

0

There are 0 best solutions below