#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
locale system("");
locale::global(system);
wcin.imbue(system);
wstring data;
getline(wcin,data);
wcout.imbue(system);
wcout << data << L" length=" << data.length() << endl;
locale utfFile("en_US.UTF-8");
wofstream file("my_utf_file.txt");
file.imbue(utfFile);
file << data;
file << endl;
file.close();
return 0;
}
问问题
1943 次