А подскажите, пожалуйста, как корректно сохранять кириллицу в файл? Перерыл все, что мог. Нигде не могу найти ответа
| Код | void __fastcall TForm1::SaveSaveAsActionExecute(TObject *Sender) { _wsetlocale(LC_ALL,L"RUSSIAN"); if (SaveSourceFileDialog ->Execute()) { if ( ( SourceFile = _wfopen(( SaveSourceFileDialog -> FileName ).c_str(),L"wt+,ccs=UNICODE")) == NULL ) Application->MessageBox(L"По какой-то причине невозможно сохранить файл", L"Ошибка!", MB_OK); else { int rowcount = StringGrid1->RowCount-1; String str2file; for (int i = 1; i <= rowcount; i++) { str2file = StringGrid1->Cells[1][i] + "\t" + StringGrid1->Cells[2][i] + "\t" + StringGrid1->Cells[3][i]+"\n"; //address value note fwprintf(SourceFile, L"%S", str2file); } fclose(SourceFile); MODIFIED = false; StatusBar1->Panels[0].Items[0]->Text = ""; } } }
|
|