我试图将内容输出到文件
std::locale::global(std::locale());
std::wofstream file(outfilename , std::wofstream::binary);
for (const auto & j : grid[0]) {
try {
std::wcout << L"String in WideString " << decoder->decode(j) << std::endl;
file << decoder->decode(j) << std::endl;
}
catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
}
wcout 停止输出任何东西(即使是“WideString 中的字符串”也没有输出),经过一定次数的调用,
(我对其进行了调试,它在停止输出文本后像预期的那样执行 wcout)
wofstream 也会在相同数量的调用后停止输出。
这是我第一次使用widestrings、streams 和couts。
感谢您查看这个。