The C++ standard library type std::wofstream is a specialized std::wostream which uses a std::wfilebuf to write wide chars or wide strings to a file.
I wrote the following program using VS2008: #include <fstream> int main() { std::wofstream fout("myfile"); fout << …
c++ windows visual-studio encoding wofstream