ofstream 解决中文路径问题

std::locale loc = std::locale::global(std::locale(""));
	ofstream testOFstream("C:\\测试.txt");
	if (testOFstream.is_open())
	{
		testOFstream<<"this is a test\n";
		testOFstream<<"this is another test";
		testOFstream.close();
	}
std::locale::global(std::locale(loc ));
原文地址:https://www.cnblogs.com/flysnail/p/2095297.html