*** pgadmin/frm/frmQuery.cpp.orig Mon Jan 7 09:19:42 2008 --- pgadmin/frm/frmQuery.cpp Wed Jan 9 13:28:14 2008 *************** *** 1292,1298 **** wxUtfFile file(lastPath, wxFile::write, modeUnicode ? wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT); if (file.IsOpened()) { ! file.Write(sqlQuery->GetText()); file.Close(); changed=false; setExtendedTitle(); --- 1292,1299 ---- wxUtfFile file(lastPath, wxFile::write, modeUnicode ? wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT); if (file.IsOpened()) { ! if ((file.Write(sqlQuery->GetText()) == 0) && (!modeUnicode)) ! wxMessageBox(_("Query text incomplete.\nQuery contained characters that could not be converted to the local charset.\nPlease correct the data or try using UTF8 instead.")); file.Close(); changed=false; setExtendedTitle(); *************** *** 1414,1420 **** void frmQuery::OnSaveAs(wxCommandEvent& event) { wxFileDialog *dlg=new wxFileDialog(this, _("Save query file as"), lastDir, lastFilename, ! _("Query files (*.sql)|*.sql|UTF-8 query files (*.sql)|*.sql|All files (*.*)|*.*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (dlg->ShowModal() == wxID_OK) { lastFilename=dlg->GetFilename(); --- 1415,1421 ---- void frmQuery::OnSaveAs(wxCommandEvent& event) { wxFileDialog *dlg=new wxFileDialog(this, _("Save query file as"), lastDir, lastFilename, ! _("Query files (*.sql)|*.sql|All files (*.*)|*.*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (dlg->ShowModal() == wxID_OK) { lastFilename=dlg->GetFilename(); *************** *** 1443,1449 **** wxUtfFile file(lastPath, wxFile::write, lastFileFormat ? wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT); if (file.IsOpened()) { ! file.Write(sqlQuery->GetText()); file.Close(); changed=false; setExtendedTitle(); --- 1444,1451 ---- wxUtfFile file(lastPath, wxFile::write, lastFileFormat ? wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT); if (file.IsOpened()) { ! if ((file.Write(sqlQuery->GetText()) == 0) && (!lastFileFormat)) ! wxMessageBox(_("Query text incomplete.\nQuery contained characters that could not be converted to the local charset.\nPlease correct the data or try using UTF8 instead.")); file.Close(); changed=false; setExtendedTitle();