wofstream ofs("c://ofs.txt"); ofs.imbue(std::locale("chs")); wstring ws = L"认命"; ofs << L"中文"; ofs.close();