summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/maingui/printergui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/maingui/printergui.cpp b/src/maingui/printergui.cpp
index 3c6b224..a54ac7a 100644
--- a/src/maingui/printergui.cpp
+++ b/src/maingui/printergui.cpp
@@ -174,7 +174,12 @@ void PrinterGui::initializeUI()
if (docName == NULL) {
docName = "Untitled";
}
- this->setWindowTitle(QString::fromUtf8("Drucken - %1 [%2]").arg(this->user, QString::fromUtf8(docName)));
+ QString docNameString = QString::fromUtf8(docName);
+ if (strcmp(docNameString.toUtf8().constData(), docName) != 0) {
+ // Not UTF-8, fallback to latin-1
+ docNameString = QString::fromLatin1(docName);
+ }
+ this->setWindowTitle(QString::fromUtf8("Drucken - %1 [%2]").arg(this->user, docNameString));
this->show();
this->showNormal();