diff options
author | Marius Kintel <marius@kintel.net> | 2012-12-14 19:42:46 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-12-14 19:42:46 (GMT) |
commit | ffae0bb3a5797aefcb5fc701ad8084d406f2a9e3 (patch) | |
tree | 2734d7f94ca221e2d56044d42cdd07497f815d60 | |
parent | 4bd97b936e2af49248e8d15f5485e09dd52fa8d5 (diff) | |
parent | c0612a9ed0899c96963e04c848a59b0164a689a2 (diff) |
Merge branch 'master' of github.com:openscad/openscad
-rw-r--r-- | src/mainwin.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index 4b0df70..dc5b79b 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -588,7 +588,9 @@ void MainWindow::refreshDocument() this->fileName.toStdString() % file.errorString().toStdString()); } else { - QString text = QTextStream(&file).readAll(); + QTextStream reader(&file); + reader.setCodec("UTF-8"); + QString text = reader.readAll(); PRINTB("Loaded design '%s'.", this->fileName.toStdString()); editor->setPlainText(text); } @@ -900,7 +902,9 @@ void MainWindow::actionSave() PRINTB("Failed to open file for writing: %s (%s)", this->fileName.toStdString() % file.errorString().toStdString()); } else { - QTextStream(&file) << this->editor->toPlainText(); + QTextStream writer(&file); + writer.setCodec("UTF-8"); + writer << this->editor->toPlainText(); PRINTB("Saved design '%s'.", this->fileName.toStdString()); this->editor->setContentModified(false); } |