1

In a UTF-8 batch, I try to invoke:

powershell Start-Process cmd.exe -Verb runAs -Arg '/k chcp 65001 ^& echo été'

But the echo was :

Page de codes active : 65001
├®t├®

C:\WINDOWS\system32>

I would like "été" and not "├®t├®"

1
  • Have you tried the new Windows Terminal? Commented Jan 11, 2020 at 15:10

1 Answer 1

1

You need to set the Console.OutputEncoding to UTF8 like this:

powershell.exe -Command {
    [Console]::OutputEncoding = [System.Text.Encoding]::Utf8
    Start-Process cmd.exe -Verb runAs -Arg '/k echo été'
}

Result:

été

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.