如何使用C ++在Windows控制台应用程序中打印"👩" emoji(Unicode代码1F469)?
在下面的示例中,我关注了Printing UTF-8 Text to the Windows Console。
#include <iostream>
#include <io.h>
#include <fcntl.h>
int main()
{
_setmode(_fileno(stdout), _O_U16TEXT);
std::wcout << L"face: 👩\n";
return 0;
}
但是它只打印两个问号:
“命令提示符”(cmd.exe
)应用程序无法呈现此字符,因此我正在使用可以呈现它的Windows Terminal:
Windows控制台无法显示Plane 0以外的字符。Windows终端旨在改善Windows控制台的限制。
进一步阅读:How to use unicode characters in Windows command line?