Some applications like dotnet query the "standard output encoding" before writing to std out.
Without changing the console encoding - unsupported charaters are replaced with "?". Reading that e.g. with Utf8 Encoding does not help.
To change the console code page a custom encoding can be used via ProcessStartInfo. Therefore it would be great if CreateStartInfo() could become protected virtual. Another alternative would be an ExecuteAsync overload with an ProcessStartInfo adjustment delegate like:
public delegate void AdjustStartInfo(ref ProcessStartInfo info);
On windows there is a "Change code page utility (chcp)". So a command could be changed to "cmd /c chcp 65001 >NUL && REAL_COMMAND". But this is quite ugly.
Details
Some applications like dotnet query the "standard output encoding" before writing to std out.
Without changing the console encoding - unsupported charaters are replaced with "?". Reading that e.g. with Utf8 Encoding does not help.
To change the console code page a custom encoding can be used via ProcessStartInfo. Therefore it would be great if
CreateStartInfo()
could becomeprotected virtual
. Another alternative would be anExecuteAsync
overload with an ProcessStartInfo adjustment delegate like:On windows there is a "Change code page utility (chcp)". So a command could be changed to "cmd /c chcp 65001 >NUL && REAL_COMMAND". But this is quite ugly.