gpt4 book ai didi

c - 如何将 Windows 控制台输出代码页设置为 1252 以外的代码页?

转载 作者:太空宇宙 更新时间:2023-11-03 23:31:47 24 4
gpt4 key购买 nike

在 Visual C 中编码,Windows 似乎使用 1252 代码页输出文本。

如何将代码页设置为其他内容,例如UTF7,来自 C 代码? (例如,API 函数调用是什么?)

我看了How to Output Unicode Strings on the Windows Console但它没有给出我的具体问题的确切答案。

还有 this answer展示了如何显示当前代码页,但没有展示如何从 C 设置代码页。

最佳答案

You must pick an 8-bit encoding, CP_UTF8 is a good idea. You must then also change the font to a non-terminal font. Consolas is a good idea. – Hans Passant

SetConsoleOutputCP

关于c - 如何将 Windows 控制台输出代码页设置为 1252 以外的代码页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13734493/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com