Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 控制台c+中的wchar_t字符输出不正确+;_C++_Unicode_Console_Wchar T - Fatal编程技术网

C++ 控制台c+中的wchar_t字符输出不正确+;

C++ 控制台c+中的wchar_t字符输出不正确+;,c++,unicode,console,wchar-t,C++,Unicode,Console,Wchar T,我尝试将wchar__t字符按其整数索引打印到控制台,但其中一些字符显示为空矩形,而对于其中一些字符(例如汉字),效果很好 我有以下代码: #include <iostream> #include <iomanip> #include <fcntl.h> #include <io.h> #include <conio.h> #include <codecvt> #include <cmath> using na

我尝试将wchar__t字符按其整数索引打印到控制台,但其中一些字符显示为空矩形,而对于其中一些字符(例如汉字),效果很好

我有以下代码:

#include <iostream>
#include <iomanip>
#include <fcntl.h>
#include <io.h>
#include <conio.h>
#include <codecvt>
#include <cmath>

using namespace std;

int main() {
    _setmode(_fileno(stdout), _O_U16TEXT);

    wcout << L"Example 1: " << wchar_t(25500) << "\n";
    wcout << L"Example 2: " << wchar_t(831) << "\n";

    return 0;
};
#包括
#包括
#包括
#包括
#包括
#包括
#包括
使用名称空间std;
int main(){
_setmode(_fileno(stdout),_O_16text);

wcout并非所有字体都包含所有字形。您可以使用字符映射实用程序(开始>Windows附件)签出正在使用的字体.
conio.h
不是标准标题。请相应地标记您的问题。我在该列表中没有看到MS哥特式。@ÖTiib我看不到控制台中有任何可用的字体。您使用的是什么窗口?Mine windows 10命令提示符/properties/font似乎首选了console、Courier New和Liberation Mono。