Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在尝试将一些宽字符写入文件时,文件的所有输出都会在这些字符之后停止。我不知道发生了什么事。
wofstream file("c:\\test.txt"); file << L"seen" << L"您好" << "unseen";
源代码中的非 ASCII 字符以实现定义的方式进行解析。使用十六进制序列或更新的(c99 或 C++11 后)unicode 字符文字并使用它们的 UTF-8/16/32 代码点表示。
这是实现定义的行为,所以除非你绝对确定你的编译器能满足你的期望,否则不要这样做。