From 5cff5654ca51aa4d939a06acfbbbf790d98a383d Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 29 Sep 2021 14:03:51 +0200 Subject: [PATCH] Gui: [skip ci] handle exception text as UTF-8 encoded string when saving failed --- src/Gui/Document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 3079939e7d..c4fdf1a943 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -1167,7 +1167,7 @@ bool Document::save(void) "or you do not have sufficient permissions, " "or for other reasons. Error details:\n\n\"%1\"\n\n" "Would you like to save the file with a different name?") - .arg(QString::fromLatin1(e.what())), + .arg(QString::fromUtf8(e.what())), QMessageBox::Yes, QMessageBox::No); if (ret == QMessageBox::No) { // TODO: Understand what exactly is supposed to be returned here @@ -1225,7 +1225,7 @@ bool Document::saveAs(void) "or you do not have sufficient permissions, " "or for other reasons. Error details:\n\n\"%1\"\n\n" "Would you like to save the file with a different name?") - .arg(QString::fromLatin1(e.what())), + .arg(QString::fromUtf8(e.what())), QMessageBox::Yes, QMessageBox::No); if (ret == QMessageBox::No) { // TODO: Understand what exactly is supposed to be returned here