Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1101,11 +1101,13 @@ private ProcessStartInfo GetProcessStartInfo(bool redirectOutput, bool redirectE
if (redirectOutput)
Comment thread
SteveL-MSFT marked this conversation as resolved.
Outdated
Comment thread
SteveL-MSFT marked this conversation as resolved.
Outdated
{
startInfo.RedirectStandardOutput = true;
startInfo.StandardOutputEncoding = Console.OutputEncoding;
}

if (redirectError)
{
startInfo.RedirectStandardError = true;
startInfo.StandardErrorEncoding = Console.OutputEncoding;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ Describe "Native Command Processor" -tags "Feature" {
$ps.Dispose()
}
}

It "OutputEncoding should be used" -Skip:(!$IsWindows -or !(Get-Command sfc.exe)) {

$originalOutputEncoding = [Console]::OutputEncoding
try {
[Console]::OutputEncoding = [System.Text.Encoding]::Unicode
sfc | Out-String | Should -Not -Match "`0"
Comment thread
iSazonov marked this conversation as resolved.
Outdated
}
finally {
[Console]::OutputEncoding = $originalOutputEncoding
}
}
}

Describe "Open a text file with NativeCommandProcessor" -tags @("Feature", "RequireAdminOnWindows") {
Expand Down