我試着寫在Linux中wstrings(俄文),在C++下面的代碼代碼:無法寫入帶俄語字符wstring的提交
ofstream outWFile;
outWFile.open("input.tab");
outWFile<< WStringToString(w->get_form());
outWFile<<"\t";
outWFile<<WStringToString(w->get_tag());
std::string WStringToString(const std::wstring& s)
{
std::string temp(s.length(),' ');
std::copy(s.begin(), s.end(), temp.begin());
return temp;
}
input.tab內容是無效的
我試圖做什麼建議在stackoverflow包括 Unable to write a std::wstring into wofstream 但我沒有幫助。 預先感謝您
可能重複的[無法寫入一個std :: wstring的成wofstream](http://stackoverflow.com/questions/5104329/unable-to-write-a-stdwstring-into-wofstream) – Griwes 2012-08-14 20:35:48
那些'ostream <<'應該是'outWFile'? – Etherealone 2012-08-14 20:38:41
您的代碼根本不顯示寫入文件,只顯示標準輸出。 – bames53 2012-08-14 21:03:20