0

我试图将内容输出到文件

  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。

感谢您查看这个。

4

1 回答 1

0

这是€符号,它阻止 wcout 和 wofstream 工作,从输入文件中删除它,我从中获取数据,使一切按预期工作,非常奇怪

于 2018-05-18T10:04:20.887 回答