-rw-r--r-- | core/apps/textedit/textedit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index f99f259..c1f74bb 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -738,49 +738,50 @@ bool TextEdit::save() qDebug("File named "+name); QString rt = editor->text(); if( !rt.isEmpty() ) { if(name.isEmpty()) { saveAs(); } else { currentFileName= name ; qDebug("saveFile "+currentFileName); struct stat buf; mode_t mode; stat(file.latin1(), &buf); mode = buf.st_mode; if(!fileIs) { doc->setName( name); FileManager fm; if ( !fm.saveFile( *doc, rt ) ) { return false; } } else { qDebug("regular save file"); QFile f(file); if( f.open(IO_WriteOnly)) { - f.writeBlock(rt,rt.length()); + QCString crt = rt.utf8(); + f.writeBlock(crt,crt.length()); } else { QMessageBox::message("Text Edit","Write Failed"); return false; } } editor->setEdited( FALSE); edited1=FALSE; edited=FALSE; if(caption().left(1)=="*") setCaption(caption().right(caption().length()-1)); chmod( file.latin1(), mode); } return true; } return false; } /*! prompted save */ bool TextEdit::saveAs() { |