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 ));
posted @ 2011-07-01 10:41  陈朋  阅读(1290)  评论(0编辑  收藏  举报