Hi
I've written the following code
Qt Code:
  1. QString filename;
  2. filename = QFileDialog::getSaveFileName(this,"Choose where to save","","*.jobs");
  3. if (!filename.isEmpty()){
  4. QFile file(filename);
  5. if (file.open(QFile::WriteOnly)){
  6. QTextStream out(&file);
  7. out.setCodec("ISO 8859-1");
  8. out << ui->teScript->toPlainText();
  9. file.close();
  10. }
  11. else
  12. QMessageBox::critical(this,"Error opening file",filename + "\ncould not be opened",QMessageBox::Ok);
  13. }
To copy to clipboard, switch view to plain text mode 

Where teScript is a QTextEdit. So If I write something like (on the text edit, when executing the program):

Hello
my name is
John
Smith

and then I open the generated txt file (with notepad) i get every line concatenated with a strange square character in the middle.

So I was wondering how I could possibly fix this problem?
PS: The problem is in Windows.