问题标签 [wofstream]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - wofstream 不在文件中写入日文字符
我正在尝试使用 wofstream 和 wstring 将日语写入文件。g++
不幸的是,当使用or clang++
(in WSL
and )编译时 wofstream 不会将日文字符写入文件Windows 10
而没有附加标志。
文件.txt
但,
file.txt
有0 bytes
大小。
但是当使用以下代码使用MSVC编译时,
file.txt有:
お姉ちゃん、おはよう!
希望我的应用程序同时在 linux 和 Windows 上运行。msvc
它适用于带有(使用string
,char
和fstream
s [这很好])的窗口。我不认为MSVC
是在 linux 上,因此我尝试使用wstring
,wchat_t
和wfstream
s g++
(在WSL
和 Windows cmd 中),但他们不会将日语写入文件。