Accented characters changed in a script called in é

Solved
OldPapy -  
 Anonymous user -

Hello,

In: PowerShell under Visual Studio Code

Script1.ps1, Write-Host "é" displays correctly

Script2.ps1, Write-Host "é" displays correctly

When Script1.ps1 launches Script2.ps1:

powershell -executionpolicy bypass ".\Script2.ps1"

In Script2.ps1, Write-Host "é" which was displaying correctly

after the call, the character é displays as é

Please let me know how to prevent this change

Thank you in advance.

3 réponses

Anonymous user
 

Hello

did you set the encoding to unicode?

https://learn.microsoft.com/fr-fr/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7.3

If so, try other formats utf16 or 32


When I was little, the Dead Sea was just sick.
George Burns

0
OldPapy
 

Hello,

Thank you for getting back to me.

Sorry for the inconvenience, but today,

the problem has disappeared, the called module is no longer changing to ASCII..

Thanks again.

OldPapy

0
Anonymous user
 

In that case, remember to mark the issue as resolved


When I was little, the Dead Sea was just sick.
George Burns

0