Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个需要在代码页 950 中运行的遗留命令行工具。问题是该工具在运行时会自行将代码页更改为 437,无论原始代码页是什么。
我想知道是否可以从另一个进程更改正在运行的控制台的代码页?或者是否可以禁止控制台更改其代码页?
我没有该工具的源代码。以上方法是我能想到的唯一解决方案。
有什么建议么?
运行工具时使用注入/绕行。挂钩函数 SetConsoleCP 和 SetConsoleOutputCP。看来,这是唯一的方法)