Is it possible to change the code page of a running console from another process?

461 Views Asked by At

I have a legacy command line tool that needs to run in codepage 950. The problem is that the tool changes the codepage to 437 by itself when it runs, no matter what the original code page is.

I would like to know if it is possible to change the code page of a running console from another process? Or if it is possible to ban a console from changing its code page?

I don't have the source code of the tool. The above ways are the only solutions that I can think of.

Any suggestions?

1

There are 1 best solutions below

0
On

Use injects/detours when running tool. Hook functions SetConsoleCP and SetConsoleOutputCP. Seems, this is the only way )