[education/rkward] /: Set QT_NO_CAST_FROM_ASCII globally

Thomas Friedrichsmeier null at kde.org
Sun Apr 27 07:48:13 BST 2025


Git commit 75d4bd96fec364169266f80de08d5026630ec050 by Thomas Friedrichsmeier.
Committed on 27/04/2025 at 06:47.
Pushed by tfry into branch 'master'.

Set QT_NO_CAST_FROM_ASCII globally

M  +0    -2    CMakeLists.txt
M  +0    -1    rkward/agents/CMakeLists.txt
M  +0    -1    rkward/autotests/CMakeLists.txt
M  +0    -2    rkward/core/CMakeLists.txt
M  +0    -1    rkward/dataeditor/CMakeLists.txt
M  +0    -1    rkward/dialogs/CMakeLists.txt
M  +20   -20   rkward/main.cpp
M  +0    -1    rkward/misc/CMakeLists.txt
M  +0    -1    rkward/plugin/CMakeLists.txt
M  +2    -0    rkward/rbackend/rcommand.h
M  +28   -28   rkward/rbackend/rcommandstack.cpp
M  +6    -7    rkward/rbackend/rkbackendtransmitter.cpp
M  +93   -71   rkward/rbackend/rkfrontendtransmitter.cpp
M  +48   -49   rkward/rbackend/rkrbackend.cpp
M  +24   -24   rkward/rbackend/rkrbackendprotocol_backend.cpp
M  +27   -27   rkward/rbackend/rkrbackendprotocol_shared.cpp
M  +1    -0    rkward/rbackend/rkrbackendprotocol_shared.h
M  +11   -11   rkward/rbackend/rkrinterface.cpp
M  +3    -3    rkward/rbackend/rkrsupport.cpp
M  +29   -29   rkward/rbackend/rksessionvars.cpp
M  +4    -4    rkward/rbackend/rkstructuregetter.cpp
M  +25   -26   rkward/rbackend/rktransmitter.cpp
M  +8    -5    rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
M  +6    -6    rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
M  +24   -19   rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
M  +104  -100  rkward/rkconsole.cpp
M  +49   -46   rkward/rkward.cpp
M  +14   -13   rkward/robjectviewer.cpp
M  +0    -1    rkward/scriptbackends/CMakeLists.txt
M  +0    -1    rkward/settings/CMakeLists.txt
M  +0    -1    rkward/windows/CMakeLists.txt

https://invent.kde.org/education/rkward/-/commit/75d4bd96fec364169266f80de08d5026630ec050

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2ee82946..5941084ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,8 +41,6 @@ ENDIF(FORCE_PRETTY_MAKEFILE)
 
 ADD_DEFINITIONS(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
 
-remove_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove to compley to KDECompilerSettings
-
 #uncomment the line below to save ~250-350kB in object size
 #ADD_DEFINITIONS(-DRKWARD_NO_TRACE)
 
diff --git a/rkward/agents/CMakeLists.txt b/rkward/agents/CMakeLists.txt
index a975fb58f..77d1f480b 100644
--- a/rkward/agents/CMakeLists.txt
+++ b/rkward/agents/CMakeLists.txt
@@ -19,4 +19,3 @@ SET(agents_STAT_SRCS
 
 ADD_LIBRARY(agents STATIC ${agents_STAT_SRCS})
 TARGET_LINK_LIBRARIES(agents Qt6::Widgets KF6::TextEditor KF6::I18n KF6::Service KF6::KIOCore KF6::KIOWidgets)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/autotests/CMakeLists.txt b/rkward/autotests/CMakeLists.txt
index 4f8d4a029..b53052f1a 100644
--- a/rkward/autotests/CMakeLists.txt
+++ b/rkward/autotests/CMakeLists.txt
@@ -20,4 +20,3 @@ endmacro()
 rkward_executable_tests(
   core_test
 )
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/core/CMakeLists.txt b/rkward/core/CMakeLists.txt
index 0d45b956f..af075bc0f 100644
--- a/rkward/core/CMakeLists.txt
+++ b/rkward/core/CMakeLists.txt
@@ -18,5 +18,3 @@ SET(core_STAT_SRCS
 
 ADD_LIBRARY(core STATIC ${core_STAT_SRCS})
 TARGET_LINK_LIBRARIES(core Qt6::Core Qt6::Widgets KF6::WidgetsAddons KF6::I18n KF6::Parts)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
-
diff --git a/rkward/dataeditor/CMakeLists.txt b/rkward/dataeditor/CMakeLists.txt
index b4998daf3..5bfa67966 100644
--- a/rkward/dataeditor/CMakeLists.txt
+++ b/rkward/dataeditor/CMakeLists.txt
@@ -15,4 +15,3 @@ SET(dataeditor_STAT_SRCS
 
 ADD_LIBRARY(dataeditor STATIC ${dataeditor_STAT_SRCS})
 TARGET_LINK_LIBRARIES(dataeditor Qt6::Widgets KF6::WidgetsAddons KF6::Parts KF6::I18n)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/dialogs/CMakeLists.txt b/rkward/dialogs/CMakeLists.txt
index 538deb668..b7399a38a 100644
--- a/rkward/dialogs/CMakeLists.txt
+++ b/rkward/dialogs/CMakeLists.txt
@@ -18,4 +18,3 @@ SET(dialogs_STAT_SRCS
 ADD_DEFINITIONS(-DLIBEXECDIR="${KDE_INSTALL_LIBEXECDIR}")
 ADD_LIBRARY(dialogs STATIC ${dialogs_STAT_SRCS})
 TARGET_LINK_LIBRARIES(dialogs Qt6::Widgets KF6::Parts KF6::ConfigWidgets KF6::TextEditor KF6::I18n KF6::KIOWidgets)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/main.cpp b/rkward/main.cpp
index 9a5fad1e5..30b66a75c 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -86,9 +86,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
 #include "version.h"
 
 #ifdef Q_OS_WIN
-#	define PATH_VAR_SEP ';'
+#	define PATH_VAR_SEP u';'
 #else
-#	define PATH_VAR_SEP ':'
+#	define PATH_VAR_SEP u':'
 #endif
 
 bool RK_Debug_Terminal = true;
@@ -123,18 +123,18 @@ void RKDebugMessageOutput (QtMsgType type, const QMessageLogContext &ctx, const
 /** The point of this redirect (to be called via the RK_DEBUG() macro) is to separate RKWard specific debug messages from
  * any other noise, coming from Qt / kdelibs. Also it allows us to retain info on flags and level, and to show messages
  * in a tool window, esp. for debugging plugins. */
-void RKDebug (int flags, int level, const char *fmt, ...) {
-	const int bufsize = 1024*8;
+void RKDebug(int flags, int level, const char *fmt, ...) {
+	const int bufsize = 1024 * 8;
 	char buffer[bufsize];
 
 	va_list ap;
-	va_start (ap, fmt);
-	vsnprintf (buffer, bufsize-1, fmt, ap);
-	va_end (ap);
-	RKDebugMessageOutput (QtDebugMsg, QMessageLogContext (), buffer);
-	if (QApplication::instance ()->thread () == QThread::currentThread ()) {
+	va_start(ap, fmt);
+	vsnprintf(buffer, bufsize - 1, fmt, ap);
+	va_end(ap);
+	RKDebugMessageOutput(QtDebugMsg, QMessageLogContext(), QString::fromUtf8(buffer));
+	if (QApplication::instance()->thread() == QThread::currentThread()) {
 		// not safe to call from any other than the GUI thread
-		RKDebugMessageWindow::newMessage (flags, level, QString (buffer));
+		RKDebugMessageWindow::newMessage(flags, level, QString::fromUtf8(buffer));
 	}
 }
 
@@ -171,7 +171,7 @@ int main (int argc, char *argv[]) {
 	KUrlAuthorized::allowUrlAction (QStringLiteral("redirect"), QUrl(QStringLiteral("rkward://")), QUrl (QStringLiteral("help:")));
 
 	KLocalizedString::setApplicationDomain ("rkward");
-	KAboutData aboutData (QStringLiteral("rkward"), i18n ("RKWard"), RKWARD_VERSION, i18n ("Frontend to the R statistics language"), KAboutLicense::GPL, i18n ("(c) 2002 - 2025"), QString (), QStringLiteral("https://rkward.kde.org"));
+	KAboutData aboutData(QStringLiteral("rkward"), i18n("RKWard"), QStringLiteral(RKWARD_VERSION), i18n("Frontend to the R statistics language"), KAboutLicense::GPL, i18n("(c) 2002 - 2025"), QString(), QStringLiteral("https://rkward.kde.org"));
 	aboutData.addAuthor (i18n ("Thomas Friedrichsmeier"), i18n ("Project leader / main developer"));
 	aboutData.addAuthor (i18n ("Pierre Ecochard"), i18n ("C++ developer between 2004 and 2007"));
 	aboutData.addAuthor (i18n ("Prasenjit Kapat"), i18n ("Many plugins, suggestions, plot history feature"));
@@ -208,7 +208,7 @@ int main (int argc, char *argv[]) {
 	RK_Debug::RK_Debug_Level = DL_FATAL - args[RKCommandLineArgs::DebugLevel].toInt();
 	RK_Debug::RK_Debug_Flags = args[RKCommandLineArgs::DebugFlags].toInt();
 	RK_Debug_Terminal = args[RKCommandLineArgs::DebugOutput].toString() == QLatin1String("terminal");
-	if (RK_Debug::setupLogFile(QDir::tempPath() + "/rkward.frontend")) {
+	if (RK_Debug::setupLogFile(QDir::tempPath() + u"/rkward.frontend"_s)) {
 		RK_DEBUG(APP, DL_INFO, "Full debug output is at %s", qPrintable(RK_Debug::debug_file->fileName()));
 	} else {
 		RK_Debug_Terminal = true;
@@ -216,20 +216,20 @@ int main (int argc, char *argv[]) {
 	}
 	qInstallMessageHandler(RKDebugMessageOutput);
 	RK_DO({
-		RK_DEBUG(APP, DL_DEBUG, "Basic runtime info (expected to be incomplete at this stage):\n%s", qPrintable(RKSessionVars::frontendSessionInfo().join("\n")));
+		RK_DEBUG(APP, DL_DEBUG, "Basic runtime info (expected to be incomplete at this stage):\n%s", qPrintable(RKSessionVars::frontendSessionInfo().join(u"\n"_s)));
 	}, APP, DL_DEBUG);
 
 	// MacOS may need some path adjustments, first
 #if defined(Q_OS_MACOS)
-	QString oldpath = qgetenv ("PATH");
-	if (!oldpath.contains (INSTALL_PATH)) {
+	QString oldpath = QString::fromLocal8Bit(qgetenv("PATH"));
+	if (!oldpath.contains(QStringLiteral(INSTALL_PATH))) {
 		//ensure that PATH is set to include what we deliver with the bundle
-		qputenv ("PATH", QString ("%1/bin:%1/sbin:%2").arg (INSTALL_PATH).arg (oldpath).toLocal8Bit ());
-		if (RK_Debug::RK_Debug_Level > 3) qDebug ("Adjusting system path to %s", qPrintable (qgetenv ("PATH")));
+		qputenv("PATH", QStringLiteral("%1/bin:%1/sbin:%2").arg(QStringLiteral(INSTALL_PATH)).arg(oldpath).toLocal8Bit());
+		if (RK_Debug::RK_Debug_Level > 3) qDebug("Adjusting system path to %s", qPrintable(qgetenv("PATH")));
 	}
 #elif defined(Q_OS_UNIX)
-	QStringList data_dirs = QString(qgetenv("XDG_DATA_DIRS")).split(PATH_VAR_SEP);;
-	QString reldatadir = QDir::cleanPath(QDir(app.applicationDirPath()).absoluteFilePath(REL_PATH_TO_DATA));
+	QStringList data_dirs = QString::fromLocal8Bit(qgetenv("XDG_DATA_DIRS")).split(PATH_VAR_SEP);
+	QString reldatadir = QDir::cleanPath(QDir(app.applicationDirPath()).absoluteFilePath(QStringLiteral(REL_PATH_TO_DATA)));
 	if (!data_dirs.contains(reldatadir)) {
 		RK_DEBUG(APP, DL_WARNING, "Running from non-standard path? Adding %s to XDG_DATA_DIRS", qPrintable(reldatadir));
 		data_dirs.prepend(reldatadir);
@@ -237,7 +237,7 @@ int main (int argc, char *argv[]) {
 	}
 #endif
 	// This is _not_ the same path adjustment as above: Make sure to add the current dir to the path, before launching R and backend.
-	QStringList syspaths = QString(qgetenv("PATH")).split(PATH_VAR_SEP);
+	QStringList syspaths = QString::fromLocal8Bit(qgetenv("PATH")).split(PATH_VAR_SEP);
 	if (!syspaths.contains(app.applicationDirPath())) {
 		syspaths.prepend(app.applicationDirPath());
 		qputenv("PATH", syspaths.join(PATH_VAR_SEP).toLocal8Bit());
diff --git a/rkward/misc/CMakeLists.txt b/rkward/misc/CMakeLists.txt
index 8399a613c..ff0da775d 100644
--- a/rkward/misc/CMakeLists.txt
+++ b/rkward/misc/CMakeLists.txt
@@ -40,4 +40,3 @@ SET(misc_STAT_SRCS
 
 ADD_LIBRARY(misc STATIC ${misc_STAT_SRCS})
 TARGET_LINK_LIBRARIES(misc Qt6::Widgets KF6::WidgetsAddons KF6::KIOWidgets Qt6::Xml Qt6::DBus KF6::ConfigCore KF6::Parts KF6::WindowSystem KF6::TextEditor KF6::Archive KF6::I18n)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/plugin/CMakeLists.txt b/rkward/plugin/CMakeLists.txt
index 3f4ef355c..7cf20427b 100644
--- a/rkward/plugin/CMakeLists.txt
+++ b/rkward/plugin/CMakeLists.txt
@@ -37,4 +37,3 @@ SET(plugin_STAT_SRCS
 
 ADD_LIBRARY(plugin STATIC ${plugin_STAT_SRCS})
 TARGET_LINK_LIBRARIES(plugin Qt6::Widgets KF6::TextEditor KF6::WindowSystem KF6::I18n)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/rbackend/rcommand.h b/rkward/rbackend/rcommand.h
index 73f6358b2..2d350c690 100644
--- a/rkward/rbackend/rcommand.h
+++ b/rkward/rbackend/rcommand.h
@@ -18,6 +18,8 @@ class RCommand;
 class RCommandProxy;
 class RObject;
 
+using namespace Qt::Literals::StringLiterals;
+
 /** R Commands can be arranged in a simple chain to make sure they are not interrupted by other commands.
  *  Also, command may need to run sub-commands.
 @see \ref UsingTheInterfaceToR
diff --git a/rkward/rbackend/rcommandstack.cpp b/rkward/rbackend/rcommandstack.cpp
index b9b0b0706..13a6d6aba 100644
--- a/rkward/rbackend/rcommandstack.cpp
+++ b/rkward/rbackend/rcommandstack.cpp
@@ -240,54 +240,54 @@ int RCommandStackModel::columnCount (const QModelIndex&) const {
 	return NUM_COLS;
 }
 
-QVariant RCommandStackModel::data (const QModelIndex& index, int role) const {
-	RK_ASSERT (listeners);
-	RK_TRACE (RBACKEND);
+QVariant RCommandStackModel::data(const QModelIndex& index, int role) const {
+	RK_ASSERT(listeners);
+	RK_TRACE(RBACKEND);
 
-	if (!index.isValid ()) return QVariant ();
-	RK_ASSERT (index.model () == this);
+	if (!index.isValid()) return QVariant();
+	RK_ASSERT(index.model() == this);
 
-	RCommandChain* index_data = static_cast<RCommandChain*> (index.internalPointer ());
+	RCommandChain* index_data = static_cast<RCommandChain*>(index.internalPointer());
 
 	if (index_data->is_command) {
-		RCommand *command = index_data->toCommand ();
-		if ((index.column () == MAIN_COL) && (role == Qt::DisplayRole)) return (command->command ());
-		if ((index.column () == FLAGS_COL) && (role == Qt::DisplayRole)) {
+		RCommand* command = index_data->toCommand();
+		if ((index.column() == MAIN_COL) && (role == Qt::DisplayRole)) return (command->command());
+		if ((index.column() == FLAGS_COL) && (role == Qt::DisplayRole)) {
 			QString ret;
-			if (command->type () & RCommand::User) ret += 'U';
-			if (command->type () & RCommand::Plugin) ret += 'P';
-			if (command->type () & RCommand::App) ret += 'A';
-			if (command->type () & RCommand::Sync) ret += 'S';
-			if (command->type () & RCommand::EmptyCommand) ret += 'E';
-			if (command->type () & (RCommand::GetIntVector | RCommand::GetRealVector | RCommand::GetStringVector | RCommand::GetStructuredData)) ret += 'D';
-			if (command->type () & RCommand::CCOutput) ret += 'O';
+			if (command->type() & RCommand::User) ret += u'U';
+			if (command->type() & RCommand::Plugin) ret += u'P';
+			if (command->type() & RCommand::App) ret += u'A';
+			if (command->type() & RCommand::Sync) ret += u'S';
+			if (command->type() & RCommand::EmptyCommand) ret += u'E';
+			if (command->type() & (RCommand::GetIntVector | RCommand::GetRealVector | RCommand::GetStringVector | RCommand::GetStructuredData)) ret += u'D';
+			if (command->type() & RCommand::CCOutput) ret += u'O';
 			return (ret);
 		}
-		if ((index.column () == STATUS_COL) && (role == Qt::DisplayRole)) {
+		if ((index.column() == STATUS_COL) && (role == Qt::DisplayRole)) {
 			QString ret;
-			if (command->status & RCommand::Running) ret += i18n ("Running");
+			if (command->status & RCommand::Running) ret += i18n("Running");
 			if (command->status & RCommand::Canceled) {
-				if (!ret.isEmpty ()) ret += QLatin1String(", ");
-				ret += i18n ("Canceled");
+				if (!ret.isEmpty()) ret += u", "_s;
+				ret += i18n("Canceled");
 			}
 			return (ret);
 		}
-		if ((index.column () == DESC_COL) && (role == Qt::DisplayRole)) {
-			return (command->rkEquivalent ());
+		if ((index.column() == DESC_COL) && (role == Qt::DisplayRole)) {
+			return (command->rkEquivalent());
 		}
 	} else {
 		if (index_data->parent) {
-			if ((index.column () == MAIN_COL) && (role == Qt::DisplayRole)) return (i18n ("Command Chain"));
-			if ((index.column () == STATUS_COL) && (role == Qt::DisplayRole)) {
-				if (index_data->closed) return (i18n ("Closed"));
-				return (i18n ("Waiting"));
+			if ((index.column() == MAIN_COL) && (role == Qt::DisplayRole)) return (i18n("Command Chain"));
+			if ((index.column() == STATUS_COL) && (role == Qt::DisplayRole)) {
+				if (index_data->closed) return (i18n("Closed"));
+				return (i18n("Waiting"));
 			}
 		} else {
-			if ((index.column () == MAIN_COL) && (role == Qt::DisplayRole)) return (i18n ("Command Stack"));
+			if ((index.column() == MAIN_COL) && (role == Qt::DisplayRole)) return (i18n("Command Stack"));
 		}
 	}
 
-	return (QVariant ());
+	return (QVariant());
 }
 
 Qt::ItemFlags RCommandStackModel::flags (const QModelIndex& index) const {
diff --git a/rkward/rbackend/rkbackendtransmitter.cpp b/rkward/rbackend/rkbackendtransmitter.cpp
index 2a8e6c8f2..e4018282d 100644
--- a/rkward/rbackend/rkbackendtransmitter.cpp
+++ b/rkward/rbackend/rkbackendtransmitter.cpp
@@ -54,7 +54,7 @@ void RKRBackendTransmitter::run () {
 		std::cout << token.toLocal8Bit().data() << "\n";
 		std::cout.flush();
 	} while (!connection->waitForConnected(1000) && (++timeout < 20));
-	if (timeout >= 20) handleTransmissionError("Could not connect: " + connection->errorString());
+	if (timeout >= 20) handleTransmissionError(u"Could not connect: "_s + connection->errorString());
 
 	// handshake
 	RK_DEBUG(RBACKEND, DL_DEBUG, "Connection state: %d. Now Sending handshake", con->state());
@@ -64,7 +64,7 @@ void RKRBackendTransmitter::run () {
 	connection->write ("\n");
 	bool ok = connection->waitForBytesWritten ();
 	RK_DEBUG(RBACKEND, DL_DEBUG, "Sending handshake complete, status: %s", ok ? "ok" : "fail");
-	if (!ok) handleTransmissionError("Could not write connection handshake: " + connection->errorString());
+	if (!ok) handleTransmissionError(u"Could not write connection handshake: "_s + connection->errorString());
 
 	flushtimerid = startTimer (200);	// calls flushOutput(false), periodically. See timerEvent()
 
@@ -155,12 +155,11 @@ void RKRBackendTransmitter::flushOutput (bool force) {
 	writeRequest (request);
 }
 
-void RKRBackendTransmitter::handleTransmissionError (const QString &message) {
-	RK_TRACE (RBACKEND);
+void RKRBackendTransmitter::handleTransmissionError(const QString &message) {
+	RK_TRACE(RBACKEND);
 
 	if (!connection) return;  // regular exit, or we did not even get to the point of setting up the connection.
 	if (RKRBackend::this_pointer->isKilled()) return;
-	RK_DEBUG (RBACKEND, DL_ERROR, "%s", qPrintable ("Transmission error " + message));
-	RKRBackend::tryToDoEmergencySave ();
+	RK_DEBUG(RBACKEND, DL_ERROR, "%s", qPrintable(u"Transmission error "_s + message));
+	RKRBackend::tryToDoEmergencySave();
 }
-
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 5a7c9185c..9fc5ff6a8 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -68,9 +68,9 @@ bool pathIsChildOf(const QString &parent, const QString &child) {
 
 void removeFromPathList (const char* varname, bool (*shouldRemove)(const QString &path)) {
 #ifdef Q_OS_WIN
-#	define PATH_VAR_SEP ';'
+#	define PATH_VAR_SEP u';'
 #else
-#	define PATH_VAR_SEP ':'
+#	define PATH_VAR_SEP u':'
 #endif
 	auto var = qgetenv(varname);
 	if (var.isEmpty()) return;
@@ -101,12 +101,12 @@ RKFrontendTransmitter::~RKFrontendTransmitter () {
 	delete rkd_transmitter;
 }
 
-QString localeDir () {
+QString localeDir() {
 	// adapted from KCatalog::catalogLocaleDir()
-	QString relpath = QStringLiteral ("%1/LC_MESSAGES/rkward.mo").arg (QLocale ().name ().section ('_', 0, 0));
-	QString file = QStandardPaths::locate (QStandardPaths::GenericDataLocation, QStringLiteral ("locale/") + relpath);
-	if (file.isEmpty ()) return QString ();
-	return QFileInfo (file.left (file.size() - relpath.size ())).absolutePath ();
+	QString relpath = QStringLiteral("%1/LC_MESSAGES/rkward.mo").arg(QLocale().name().section(u'_', 0, 0));
+	QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("locale/") + relpath);
+	if (file.isEmpty()) return QString();
+	return QFileInfo(file.left(file.size() - relpath.size())).absolutePath();
 }
 
 /** Check if the given path to R (or "auto") is executable, and fail with an appropriate message, otherwise. If "auto" is given as input, try to auto-locate an R installation at the standard
@@ -154,42 +154,42 @@ void RKFrontendTransmitter::detectAndCheckRBinary() {
 			}
 			RK_DEBUG(APP, DL_DEBUG, "Using R as configured in config file %s", qPrintable (rkward_ini_file.absoluteFilePath ()));
 		} else {
-			if (QFileInfo::exists(R_EXECUTABLE)) {
+			if (QFileInfo::exists(QStringLiteral(R_EXECUTABLE))) {
 				RK_DEBUG(APP, DL_DEBUG, "Using R as configured at compile time");
-				r_exe = R_EXECUTABLE;
+				r_exe = QStringLiteral(R_EXECUTABLE);
 			}
 		}
 	}
 	if (r_exe.isEmpty()) {
 		RK_DEBUG(APP, DL_DEBUG, "Falling back to auto-detection of R binary");
-		r_exe = QLatin1String("auto");
+		r_exe = QStringLiteral("auto");
 	}
 
 	RKSessionVars::r_binary = resolveRSpecOrFail(r_exe);
 }
 
-void RKFrontendTransmitter::run () {
-	RK_TRACE (RBACKEND);
+void RKFrontendTransmitter::run() {
+	RK_TRACE(RBACKEND);
 
 	quirkmode = RKCommandLineArgs::get(RKCommandLineArgs::QuirkMode).toBool();
 	detectAndCheckRBinary();
 
 	// start server
-	server = new QLocalServer (this);
+	server = new QLocalServer(this);
 	// we add a bit of randomness to the servername, as in general the servername must be unique
 	// there could be conflicts with concurrent or with previous crashed rkward sessions.
-	if (!server->listen ("rkward" + KRandom::randomString (8))) handleTransmissionError ("Failure to start frontend server: " + server->errorString ());
-	connect (server, &QLocalServer::newConnection, this, &RKFrontendTransmitter::connectAndEnterLoop, Qt::QueuedConnection);
+	if (!server->listen(u"rkward"_s + KRandom::randomString(8))) handleTransmissionError(u"Failure to start frontend server: "_s + server->errorString());
+	connect(server, &QLocalServer::newConnection, this, &RKFrontendTransmitter::connectAndEnterLoop, Qt::QueuedConnection);
 	if (quirkmode) server->setSocketOptions(QLocalServer::UserAccessOption);
 	// start backend
-	backend = new QProcess (this);
-	connect (backend, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &RKFrontendTransmitter::backendExit);
+	backend = new QProcess(this);
+	connect(backend, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &RKFrontendTransmitter::backendExit);
 
-	QStringList env = QProcess::systemEnvironment ();
+	QStringList env = QProcess::systemEnvironment();
 	// Try to synchronize language selection in frontend and backend
 	int index = env.indexOf(QRegularExpression(QStringLiteral("^LANGUAGE=.*"), QRegularExpression::CaseInsensitiveOption));  // clazy:exclude=use-static-qregularexpression ; it'll only be craeted once
-	if (index >= 0) env.removeAt (index);
-	env.append ("LANGUAGE=" + QLocale ().name ().section ('_', 0, 0));
+	if (index >= 0) env.removeAt(index);
+	env.append(u"LANGUAGE="_s + QLocale().name().section(u'_', 0, 0));
 
 	if (RKSessionVars::runningInAppImage() && RKSessionVars::isPathInAppImage(RKSessionVars::RBinary())) {
 		RK_DEBUG(RBACKEND, DL_DEBUG, "Detected running from AppImage with external R.");
@@ -201,44 +201,55 @@ void RKFrontendTransmitter::run () {
 	args.append(QStringLiteral("CMD"));
 	QString debugger = RKCommandLineArgs::get(RKCommandLineArgs::BackendDebugger).toString();
 	if (!debugger.isEmpty()) {
-		args += debugger.split(' ');
+		args += debugger.split(u' ');
 	}
 
-	QString backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath ());
+	QString backend_executable = findBackendAtPath(QCoreApplication::applicationDirPath());
 #ifdef Q_OS_MACOS
-	if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/../Resources"); // an appropriate location in a standalone app-bundle
+	if (backend_executable.isEmpty())
+		backend_executable =
+		    findBackendAtPath(QCoreApplication::applicationDirPath() + u"/../Resources"_s);  // an appropriate location in a standalone app-bundle
 #endif
-	if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/rbackend");	// for running directly from the build-dir
-	if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/../rbackend");	// for running directly from the build-test-dir
-	if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/" + REL_PATH_TO_LIBEXEC); // as calculated from cmake
+	if (backend_executable.isEmpty())
+		backend_executable = findBackendAtPath(QCoreApplication::applicationDirPath() + u"/rbackend"_s);  // for running directly from the build-dir
+	if (backend_executable.isEmpty())
+		backend_executable = findBackendAtPath(QCoreApplication::applicationDirPath() + u"/../rbackend"_s);  // for running directly from the build-test-dir
+	if (backend_executable.isEmpty())
+		backend_executable =
+		    findBackendAtPath(QCoreApplication::applicationDirPath() + u"/"_s + QStringLiteral(REL_PATH_TO_LIBEXEC));  // as calculated from cmake
 #ifdef Q_OS_MACOS
-	if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/../../../rbackend");
-	if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/../Frameworks/libexec");  // For running from .dmg created by craft --package rkward
+	if (backend_executable.isEmpty()) backend_executable = findBackendAtPath(QCoreApplication::applicationDirPath() + u"/../../../rbackend"_s);
+	if (backend_executable.isEmpty())
+		backend_executable =
+		    findBackendAtPath(QCoreApplication::applicationDirPath() + u"/../Frameworks/libexec"_s);  // For running from .dmg created by craft --package rkward
 #endif
-	if (backend_executable.isEmpty()) backend_executable = findBackendAtPath(RKWARD_BACKEND_PATH);
+	if (backend_executable.isEmpty()) backend_executable = findBackendAtPath(QStringLiteral(RKWARD_BACKEND_PATH));
 	if (backend_executable.isEmpty()) {
 		handleTransmissionError(i18n("The backend executable could not be found. This is likely to be a problem with your installation."));
-		exec();   // To actually show the transmission error
+		exec();  // To actually show the transmission error
 		return;
 	}
 
 #if defined(RK_DLOPEN_LIBRSO)
 	/** NOTE: For a description of the rationale for this involved loading procedure rkapi.h ! */
-	QString backend_lib = findBackendLibAtPath(QCoreApplication::applicationDirPath()); // for running directly from the build tree, but also covers windows
-	if (backend_lib.isEmpty()) backend_lib = findBackendLibAtPath(QCoreApplication::applicationDirPath() + "/" + REL_PATH_TO_LIB); // regular installation; rel path between bin and lib dir is calculated in cmake
-	if (backend_lib.isEmpty()) backend_lib = findBackendLibAtPath(QFileInfo(backend_executable).absolutePath()); // backend and lib both installed in libexec or similar
-#	if defined(Q_OS_MACOS)
-	if (backend_lib.isEmpty()) backend_lib = findBackendLibAtPath(QCoreApplication::applicationDirPath() + "/../Frameworks"); // MacOS bundle: rkward in /MacOS, lib in /Framweorks
-#	endif
-#	if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
+	QString backend_lib = findBackendLibAtPath(QCoreApplication::applicationDirPath());  // for running directly from the build tree, but also covers windows
+	if (backend_lib.isEmpty())
+		backend_lib = findBackendLibAtPath(QCoreApplication::applicationDirPath() + u"/"_s + QStringLiteral(REL_PATH_TO_LIB));  // regular installation; rel path between bin and lib dir is calculated in cmake
+	if (backend_lib.isEmpty())
+		backend_lib = findBackendLibAtPath(QFileInfo(backend_executable).absolutePath());  // backend and lib both installed in libexec or similar
+#if defined(Q_OS_MACOS)
+	if (backend_lib.isEmpty())
+		backend_lib = findBackendLibAtPath(QCoreApplication::applicationDirPath() + u"/../Frameworks"_s);  // MacOS bundle: rkward in /MacOS, lib in /Framweorks
+#endif
+#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
 	env.append(QStringLiteral("RK_BACKEND_LIB=") + backend_lib);
-#	else
+#else
 	env.append(QStringLiteral("RK_BACKEND_LIB=") + QFileInfo(backend_lib).fileName());
-	QTemporaryDir rkward_only_dir(QDir::tempPath() + "/rkward_only");
+	QTemporaryDir rkward_only_dir(QDir::tempPath() + u"/rkward_only"_s);
 	QFile(QFileInfo(backend_lib).absolutePath()).link(rkward_only_dir.filePath(QStringLiteral("_rkward_only_dlpath")));
 	env.append(QStringLiteral("RK_ADD_LDPATH=./_rkward_only_dlpath"));
 	env.append(QStringLiteral("RK_LD_CWD=") + rkward_only_dir.path());
-#	endif
+#endif
 #endif
 	backend->setEnvironment(env);
 
@@ -250,36 +261,43 @@ void RKFrontendTransmitter::run () {
 	// On MacOS, we cd to R_HOME, instead, below
 	QFileInfo bfi(backend_executable);
 	backend->setWorkingDirectory(bfi.absolutePath());
-#	ifdef Q_OS_WIN
+#ifdef Q_OS_WIN
 	args.append(bfi.fileName());
-#	else
-	args.append("./" + bfi.fileName());
-#	endif
+#else
+	args.append(u"./"_s + bfi.fileName());
+#endif
 #else
 	args.append(backend_executable);
 #endif
 
 	if (RKSettingsModuleGeneral::rkwardVersionChanged()) args.append(QStringLiteral("--setup"));
-	args.append (QStringLiteral("--debug-level=") + QString::number (RK_Debug::RK_Debug_Level));
-	// NOTE: QProcess quotes its arguments, *but* properly passing all spaces and quotes through the R CMD wrapper, seems near(?) impossible on Windows. Instead, we use percent encoding, internally.
-	args.append (QStringLiteral("--server-name=") + server->fullServerName ().toUtf8 ().toPercentEncoding ());
-	args.append (QStringLiteral("--rkd-server-name=") + rkd_transmitter->serverName ().toUtf8 ().toPercentEncoding ());
-	args.append (QStringLiteral("--data-dir=") + RKSettingsModuleGeneral::filesPath ().toUtf8 ().toPercentEncoding ());
-	args.append (QStringLiteral("--locale-dir=") + localeDir ().toUtf8 ().toPercentEncoding ());
-	RK_DO({
-		RK_DEBUG(RBACKEND, DL_DEBUG, "R binary: %s", qPrintable(RKSessionVars::RBinary()));
-		RK_DEBUG(RBACKEND, DL_DEBUG, "%s", qPrintable(args.join("\n")));
-	}, RBACKEND, DL_DEBUG);
+	args.append(QStringLiteral("--debug-level=") + QString::number(RK_Debug::RK_Debug_Level));
+	// NOTE: QProcess quotes its arguments, *but* properly passing all spaces and quotes through the R CMD wrapper, seems near(?) impossible on Windows.
+	// Instead, we use percent encoding, internally.
+	args.append(QStringLiteral("--server-name=") + QString::fromLatin1(server->fullServerName().toUtf8().toPercentEncoding()));
+	args.append(QStringLiteral("--rkd-server-name=") + QString::fromLatin1(rkd_transmitter->serverName().toUtf8().toPercentEncoding()));
+	args.append(QStringLiteral("--data-dir=") + QString::fromLatin1(RKSettingsModuleGeneral::filesPath().toUtf8().toPercentEncoding()));
+	args.append(QStringLiteral("--locale-dir=") + QString::fromLatin1(localeDir().toUtf8().toPercentEncoding()));
+	RK_DO(
+	    {
+		    RK_DEBUG(RBACKEND, DL_DEBUG, "R binary: %s", qPrintable(RKSessionVars::RBinary()));
+		    RK_DEBUG(RBACKEND, DL_DEBUG, "%s", qPrintable(args.join(u"\n"_s)));
+	    },
+	    RBACKEND, DL_DEBUG);
 
 #ifdef Q_OS_MACOS
 	// Resolving libR.dylib and friends is a pain on MacOS, and running through R CMD does not always seem to be enough.
 	// (Apparently DYLIB_FALLBACK_LIBRARY_PATH is ignored on newer versions of MacOS). Safest best seems to be to start in the lib directory, itself.
 	QProcess dummy;
-	dummy.start(RKSessionVars::RBinary(), QStringList() << "--slave" << "--no-save" << "--no-init-file" << "-e" << "cat(R.home('lib'))");
-	dummy.waitForFinished ();
-	QString r_home = QString::fromLocal8Bit (dummy.readAllStandardOutput ());
-	RK_DEBUG(RBACKEND, DL_INFO, "Setting working directory to %s", qPrintable (r_home));
-	backend->setWorkingDirectory (r_home);
+	dummy.start(RKSessionVars::RBinary(), QStringList() << "--slave"
+	                                                    << "--no-save"
+	                                                    << "--no-init-file"
+	                                                    << "-e"
+	                                                    << "cat(R.home('lib'))");
+	dummy.waitForFinished();
+	QString r_home = QString::fromLocal8Bit(dummy.readAllStandardOutput());
+	RK_DEBUG(RBACKEND, DL_INFO, "Setting working directory to %s", qPrintable(r_home));
+	backend->setWorkingDirectory(r_home);
 #endif
 #if defined(Q_OS_WIN)
 	// On some windows systems, the _first_ invocation of the backend seems to fail as somehow process output from the backend (the token) never arrives.
@@ -287,7 +305,7 @@ void RKFrontendTransmitter::run () {
 	QProcess dummy;
 	QStringList dummyargs = args;
 	dummy.setWorkingDirectory(backend->workingDirectory());
-	dummyargs.removeAt(dummyargs.size()-4); // the --server-name. With this empty, the backend will exit
+	dummyargs.removeAt(dummyargs.size() - 4);  // the --server-name. With this empty, the backend will exit
 	dummy.start(RKSessionVars::RBinary(), dummyargs, QIODevice::ReadOnly);
 	dummy.waitForFinished();
 	dummy.readAllStandardOutput();
@@ -311,7 +329,7 @@ void RKFrontendTransmitter::run () {
 	}
 	RK_DEBUG(RBACKEND, DL_DEBUG, "Startup done at %d. Received token length was %d", QDateTime::currentMSecsSinceEpoch(), token.length());
 
-	exec ();
+	exec();
 
 	if (!quirkmode) {
 		// It's ok to only give backend a short time to finish. We only get here, after QuitCommand has been handled by the backend
@@ -319,9 +337,9 @@ void RKFrontendTransmitter::run () {
 	}
 
 	if (!connection) {
-		RK_ASSERT (false);
+		RK_ASSERT(false);
 	}
-	RK_ASSERT(!server->isListening ());
+	RK_ASSERT(!server->isListening());
 	delete server;
 	delete backend;
 }
@@ -342,24 +360,28 @@ QString RKFrontendTransmitter::waitReadLine (QIODevice* con, int msecs) {
 	return QString::fromLocal8Bit(ret);
 }
 
-void RKFrontendTransmitter::connectAndEnterLoop () {
-	RK_TRACE (RBACKEND);
-	RK_ASSERT (server->hasPendingConnections ());
+void RKFrontendTransmitter::connectAndEnterLoop() {
+	RK_TRACE(RBACKEND);
+	RK_ASSERT(server->hasPendingConnections());
 
-	QLocalSocket *con = server->nextPendingConnection ();
-	server->close ();
+	QLocalSocket *con = server->nextPendingConnection();
+	server->close();
 
 	// handshake
 	QString token_c = waitReadLine(con, 1000).trimmed();
 	if (quirkmode) {
 		token = token_c;
 	} else {
-		if (token_c != token) handleTransmissionError (i18n ("Error during handshake with backend process. Expected token '%1', received token '%2'", token, token_c));
+		if (token_c != token)
+			handleTransmissionError(i18n("Error during handshake with backend process. Expected token '%1', received token '%2'", token, token_c));
 	}
 	QString version_c = waitReadLine(con, 1000).trimmed();
-	if (version_c != RKWARD_VERSION) handleTransmissionError (i18n ("Version mismatch during handshake with backend process. Frontend is version '%1' while backend is '%2'.\nPlease fix your installation.", QStringLiteral (RKWARD_VERSION), version_c));
+	if (version_c != QStringLiteral(RKWARD_VERSION))
+		handleTransmissionError(
+		    i18n("Version mismatch during handshake with backend process. Frontend is version '%1' while backend is '%2'.\nPlease fix your installation.",
+		         QStringLiteral(RKWARD_VERSION), version_c));
 
-	setConnection (con);
+	setConnection(con);
 }
 
 void RKFrontendTransmitter::requestReceived (RBackendRequest* request) {
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index 4550744f3..edc1a5e6e 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -292,8 +292,8 @@ int RReadConsole (const char* prompt, unsigned char* buf, int buflen, int hist)
 	// browser() also takes us here.
 	QVariantMap params;
 	RBackendRequest::RCallbackType request_type = RBackendRequest::ReadLine;
-	params[QStringLiteral("prompt")] = QVariant (prompt);
-	params[QStringLiteral("cancelled")] = QVariant (false);
+	params[QStringLiteral("prompt")] = QVariant(RKTextCodec::fromNative(prompt));
+	params[QStringLiteral("cancelled")] = QVariant(false);
 
 	// add info for browser requests
 	if (hist && (RKRBackend::default_global_context != ROb(R_GlobalContext))) {
@@ -480,11 +480,11 @@ void RCleanUp (SA_TYPE saveact, int status, int RunLast) {
 			QDir dir (RKRBackendProtocolBackend::dataDir ());
 			int i=0;
 			while (true) {
-				filename = "rkward_recover" + QString::number (i) + ".RData";
-				if (!dir.exists (filename)) break;
+				filename = u"rkward_recover"_s + QString::number(i) + u".RData"_s;
+				if (!dir.exists(filename)) break;
 				i++;
 			}
-			filename = dir.absoluteFilePath (filename);
+			filename = dir.absoluteFilePath(filename);
 
 			RFn::R_SaveGlobalEnvToFile(filename.toLocal8Bit().data());
 			RK_DEBUG(RBACKEND, DL_WARNING, "Created emergency save file in %s", qPrintable(filename));
@@ -512,17 +512,17 @@ void RCleanUp (SA_TYPE saveact, int status, int RunLast) {
 	RKRBackendProtocolBackend::doExit();
 }
 
-void RSuicide (const char* message) {
-	RK_TRACE (RBACKEND);
+void RSuicide(const char* message) {
+	RK_TRACE(RBACKEND);
 
-	if (!RKRBackend::this_pointer->isKilled ()) {
-		RBackendRequest request (true, RBackendRequest::BackendExit);
-		request.params[QStringLiteral("message")] = QVariant (i18n ("The R engine has encountered a fatal error:\n%1", message));
-		RKRBackend::this_pointer->handleRequest (&request);
+	if (!RKRBackend::this_pointer->isKilled()) {
+		RBackendRequest request(true, RBackendRequest::BackendExit);
+		request.params[u"message"_s] = QVariant(i18n("The R engine has encountered a fatal error:\n%1", RKTextCodec::fromNative(message)));
+		RKRBackend::this_pointer->handleRequest(&request);
 		RKRBackend::this_pointer->killed = RKRBackend::EmergencySaveThenExit;
-		RCleanUp (SA_SUICIDE, 1, 0);
+		RCleanUp(SA_SUICIDE, 1, 0);
 	} else {
-		RK_ASSERT (false);
+		RK_ASSERT(false);
 	}
 }
 
@@ -554,11 +554,11 @@ void RKRBackend::tryToDoEmergencySave () {
 	}
 }
 
-QStringList charPArrayToQStringList (const char** chars, int count) {
+QStringList charPArrayToQStringList(const char** chars, int count) {
 	QStringList ret;
 	for (int i = 0; i < count; ++i) {
 		// do we need to do locale conversion, here?
-		ret.append (chars[i]);
+		ret.append(RKTextCodec::fromNative(chars[i]));
 	}
 	return ret;
 }
@@ -567,7 +567,7 @@ int RChooseFile(int isnew, char *buf, int len) {
 	RK_TRACE (RBACKEND);
 
 	QStringList params;
-	params << QString() /* caption */ << QString() /* initial */ << QStringLiteral("*") /* filter */ << (isnew ? "newfile" : "file");
+	params << QString() /* caption */ << QString() /* initial */ << QStringLiteral("*") /* filter */ << (isnew ? u"newfile"_s : u"file"_s);
 	auto res = RKRBackend::this_pointer->doRCallRequest(QStringLiteral("choosefile"), params, RKRBackend::Synchronous);
 
 	QByteArray localres = RKTextCodec::toNative(res.ret.toString());
@@ -598,12 +598,12 @@ void REditFilesHelper (const QStringList &files, const QStringList &titles, cons
 	RKRBackend::this_pointer->handleRequest (&request);
 }
 
-int REditFiles (int nfile, const char **file, const char **title, const char *wtitle) {
-	RK_TRACE (RBACKEND);
+int REditFiles(int nfile, const char **file, const char **title, const char *wtitle) {
+	RK_TRACE(RBACKEND);
 
-	REditFilesHelper (charPArrayToQStringList (file, nfile), charPArrayToQStringList (title, nfile), wtitle, RBackendRequest::EditFiles, false, true);
+	REditFilesHelper(charPArrayToQStringList(file, nfile), charPArrayToQStringList(title, nfile), RKTextCodec::fromNative(wtitle), RBackendRequest::EditFiles, false, true);
 
-// default implementation seems to return 1 if nfile <= 0, else 1. No idea, what for. see unix/std-sys.c
+	// default implementation seems to return 1 if nfile <= 0, else 1. No idea, what for. see unix/std-sys.c
 	return (nfile <= 0);
 }
 
@@ -642,12 +642,12 @@ SEXP doShowFiles (SEXP files, SEXP titles, SEXP wtitle, SEXP delete_files, SEXP
 	return (doShowEditFiles (files, titles, wtitle, delete_files, prompt, RBackendRequest::ShowFiles));
 }
 
-int RShowFiles (int nfile, const char **file, const char **headers, const char *wtitle, Rboolean del, const char */* pager */) {
-	RK_TRACE (RBACKEND);
+int RShowFiles(int nfile, const char **file, const char **headers, const char *wtitle, Rboolean del, const char * /* pager */) {
+	RK_TRACE(RBACKEND);
 
-	REditFilesHelper (charPArrayToQStringList (file, nfile), charPArrayToQStringList (headers, nfile), QString (wtitle), RBackendRequest::ShowFiles, (bool) del, true);
+	REditFilesHelper (charPArrayToQStringList (file, nfile), charPArrayToQStringList (headers, nfile), RKTextCodec::fromNative(wtitle), RBackendRequest::ShowFiles, (bool) del, true);
 
-// default implementation seems to returns 1 on success, 0 on failure. see unix/std-sys.c
+	// default implementation seems to returns 1 on success, 0 on failure. see unix/std-sys.c
 	return 1;
 }
 
@@ -684,18 +684,18 @@ SEXP doDialog (SEXP caption, SEXP message, SEXP button_yes, SEXP button_no, SEXP
 	return ret;
 }
 
-void RShowMessage (const char* message) {
-	RK_TRACE (RBACKEND);
+void RShowMessage(const char* message) {
+	RK_TRACE(RBACKEND);
 
-	doDialogHelper (i18n ("Message from the R backend"), message, QStringLiteral("ok"), QString (), QString (), QStringLiteral("ok"), true);
+	doDialogHelper(i18n("Message from the R backend"), RKTextCodec::fromNative(message), u"ok"_s, QString(), QString(), u"ok"_s, true);
 }
 
 // TODO: currently used on windows, only!
-int RAskYesNoCancel (const char* message) {
-	RK_TRACE (RBACKEND);
+int RAskYesNoCancel(const char* message) {
+	RK_TRACE(RBACKEND);
 
-	if (RKRBackend::this_pointer->killed) return -1;	// HACK: At this point R asks whether to save the workspace. We have already handled that. So return -1 for "no"
-	return doDialogHelper (i18n ("Question from the R backend"), message, QStringLiteral("yes"), QStringLiteral("no"), QStringLiteral("cancel"), QStringLiteral("yes"), true);
+	if (RKRBackend::this_pointer->killed) return -1;  // HACK: At this point R asks whether to save the workspace. We have already handled that. So return -1 for "no"
+	return doDialogHelper(i18n("Question from the R backend"), RKTextCodec::fromNative(message), u"yes"_s, u"no"_s, u"cancel"_s, u"yes"_s, true);
 }
 
 void RBusy (int busy) {
@@ -871,7 +871,7 @@ SEXP doRCall (SEXP _call, SEXP _args, SEXP _sync, SEXP _nested) {
 }
 
 QString getLibLoc() {
-	return RKRBackendProtocolBackend::dataDir() + "/.rkward_packages/" + QString::number(RKRBackend::this_pointer->r_version / 10);
+	return RKRBackendProtocolBackend::dataDir() + u"/.rkward_packages/"_s + QString::number(RKRBackend::this_pointer->r_version / 10);
 }
 
 // Function to handle several simple calls from R code, that do not need any special arguments, or interaction with the frontend process.
@@ -909,11 +909,11 @@ SEXP doSimpleBackendCall (SEXP _call) {
 		else RK_ASSERT(false); // should have been handled in frontend
 	} else if (call == QLatin1String("backendSessionInfo")) {
 		// Non-translatable on purpose. This is meant for posting to the bug tracker, mostly.
-		QStringList lines("Debug message file (this may contain relevant diagnostic output in case of trouble):");
+		QStringList lines(u"Debug message file (this may contain relevant diagnostic output in case of trouble):"_s);
 		lines.append(RKRBackendProtocolBackend::backendDebugFile());
 		lines.append(QString());
 		// NOTE: R_SVN_REVISON used to be a string, but has changed to numeric constant in R 3.0.0. QString::arg() handles both.
-		lines.append(QStringLiteral("R version (compile time): %1").arg(QString(R_MAJOR "." R_MINOR " " R_STATUS " (" R_YEAR "-" R_MONTH "-" R_DAY " r%1)").arg(R_SVN_REVISION)));
+		lines.append(QStringLiteral("R version (compile time): %1").arg(QStringLiteral(R_MAJOR "." R_MINOR " " R_STATUS " (" R_YEAR "-" R_MONTH "-" R_DAY " r%1)").arg(R_SVN_REVISION)));
 		return RKRSupport::StringListToSEXP(lines);
 	}
 
@@ -1401,14 +1401,13 @@ void RKRBackend::startOutputCapture () {
 	pushOutputCapture (RecordMessages | RecordOutput);
 }
 
-void RKRBackend::printAndClearCapturedMessages (bool with_header) {
-	RK_TRACE (RBACKEND);
-
-	QString out = popOutputCapture (true);
+void RKRBackend::printAndClearCapturedMessages(bool with_header) {
+	RK_TRACE(RBACKEND);
 
-	if (out.isEmpty ()) return;
-	if (with_header) out.prepend ("<h2>Messages, warnings, or errors:</h2>\n");
-	catToOutputFile (out);
+	QString out = popOutputCapture(true);
+	if (out.isEmpty()) return;
+	if (with_header) out.prepend(u"<h2>Messages, warnings, or errors:</h2>\n"_s);
+	catToOutputFile(out);
 }
 
 void RKRBackend::run(const QString &locale_dir, bool setup) {
@@ -1572,23 +1571,23 @@ void RKRBackend::initialize(const QString &locale_dir, bool setup) {
 	// Try to load rkward package. If that fails, or is the wrong version, try to install
 	// rkward package, then load again.
 	QString libloc = getLibLoc();
-	QString versioncheck = QStringLiteral("stopifnot(.rk.app.version==\"%1\")").arg(RKWARD_VERSION);
-	QString command = "local({\n"
-	                  "  libloc <- " + RKRSharedFunctionality::quote(libloc) + "\n"
+	QString versioncheck = QStringLiteral("stopifnot(.rk.app.version==\"%1\")").arg(QStringLiteral(RKWARD_VERSION));
+	QString command = QStringLiteral("local({\n"
+	                  "  libloc <- ") + RKRSharedFunctionality::quote(libloc) + QStringLiteral("\n"
 	                  "  if (!dir.exists (libloc)) dir.create(libloc, recursive=TRUE)\n"
-	                  "  ok <- FALSE\n"
-	                  + (setup ? "# skipping: " : "") +
-	                  " suppressWarnings (try ({library (\"rkward\", lib.loc=libloc); " + versioncheck + "; ok <- TRUE}))\n"
+	                  "  ok <- FALSE\n")
+	                  + (setup ? u"# skipping: "_s : u""_s) +
+	                  QStringLiteral(" suppressWarnings (try ({library (\"rkward\", lib.loc=libloc); ") + versioncheck + QStringLiteral("; ok <- TRUE}))\n"
 	                  "  if (!ok) {\n"
 	                  "    suppressWarnings (try (detach(\"package:rkward\", unload=TRUE)))\n"
 	                  "    install.packages(normalizePath(paste(libloc, \"..\", c (\"rkward.tgz\", \"rkwardtests.tgz\"), sep=\"/\")), lib=libloc, repos=NULL, type=\"source\", INSTALL_opts=\"--no-multiarch\")\n"
 	                  "    library (\"rkward\", lib.loc=libloc)\n"
 	                  "  }\n"
 	                  "  .libPaths(c(.libPaths(), libloc))\n" // Add to end search path: Will be avaiable for help serach, but hopefully, not get into the way, otherwise
-	                  "})\n";
+	                  "})\n");
 	if (!runDirectCommand(command)) lib_load_fail = true;
 	RK_setupGettext(locale_dir);	// must happen *after* package loading, since R will re-set it
-	if (!runDirectCommand(versioncheck + "\n")) lib_load_fail = true;
+	if (!runDirectCommand(versioncheck + u"\n"_s)) lib_load_fail = true;
 	if (!runDirectCommand(QStringLiteral(".rk.fix.assignments ()\n"))) sink_fail = true;
 
 // error/output sink and help browser
diff --git a/rkward/rbackend/rkrbackendprotocol_backend.cpp b/rkward/rbackend/rkrbackendprotocol_backend.cpp
index efb310cf4..cd10c2499 100644
--- a/rkward/rbackend/rkrbackendprotocol_backend.cpp
+++ b/rkward/rbackend/rkrbackendprotocol_backend.cpp
@@ -45,17 +45,17 @@ SPDX-License-Identifier: GPL-2.0-or-later
 
 	// NOTE: This function serves no benefit over qDebug() in the backend. But provided for consistency with the frontend.
 	// See the frontend version in main.cpp
-	void RKDebug (int flags, int level, const char *fmt, ...) {
-		Q_UNUSED (flags);
-		Q_UNUSED (level);
-		const int bufsize = 1024*8;
+	void RKDebug(int flags, int level, const char *fmt, ...) {
+		Q_UNUSED(flags);
+		Q_UNUSED(level);
+		const int bufsize = 1024 * 8;
 		char buffer[bufsize];
 
 		va_list ap;
-		va_start (ap, fmt);
-		vsnprintf (buffer, bufsize-1, fmt, ap);
-		va_end (ap);
-		RKDebugMessageOutput (QtDebugMsg, QMessageLogContext (), buffer);
+		va_start(ap, fmt);
+		vsnprintf(buffer, bufsize - 1, fmt, ap);
+		va_end(ap);
+		RKDebugMessageOutput(QtDebugMsg, QMessageLogContext(), QString::fromUtf8(buffer));
 	}
 
 #ifdef RK_DLOPEN_LIBRSO
@@ -83,37 +83,37 @@ SPDX-License-Identifier: GPL-2.0-or-later
 			}
 		}
 #endif
-		QCoreApplication app (argc, argv);
+		QCoreApplication app(argc, argv);
 
 		setvbuf(stdout, nullptr, _IONBF, 0);
 		setvbuf(stderr, nullptr, _IONBF, 0);
 
 		RK_Debug::RK_Debug_Flags = RBACKEND | GRAPHICS_DEVICE;
-		if (RK_Debug::setupLogFile (QDir::tempPath () + "/rkward.rbackend")) qInstallMessageHandler (RKDebugMessageOutput);
+		if (RK_Debug::setupLogFile(QDir::tempPath() + u"/rkward.rbackend"_s)) qInstallMessageHandler(RKDebugMessageOutput);
 
 		QString servername, rkd_server_name;
 		QString data_dir, locale_dir;
 		QStringList args = app.arguments();
 		bool setup = false;
-		for (int i = 1; i < args.count (); ++i) {
-			if (args[i].startsWith (QLatin1String ("--debug-level"))) {
-				RK_Debug::RK_Debug_Level = args[i].section ('=', 1).toInt ();
-			} else if (args[i].startsWith (QLatin1String ("--server-name"))) {
-				servername = QUrl::fromPercentEncoding (args[i].section ('=', 1).toUtf8 ());
-			} else if (args[i].startsWith (QLatin1String ("--data-dir"))) {
-				data_dir = QUrl::fromPercentEncoding (args[i].section ('=', 1).toUtf8 ());
-			} else if (args[i].startsWith (QLatin1String ("--locale-dir"))) {
-				locale_dir = QUrl::fromPercentEncoding (args[i].section ('=', 1).toUtf8 ());
-			} else if (args[i].startsWith (QLatin1String ("--rkd-server-name"))) {
-				rkd_server_name = QUrl::fromPercentEncoding (args[i].section ('=', 1).toUtf8 ());
+		for (int i = 1; i < args.count(); ++i) {
+			if (args[i].startsWith(QLatin1String("--debug-level"))) {
+				RK_Debug::RK_Debug_Level = args[i].section(u'=', 1).toInt();
+			} else if (args[i].startsWith(QLatin1String("--server-name"))) {
+				servername = QUrl::fromPercentEncoding(args[i].section(u'=', 1).toUtf8());
+			} else if (args[i].startsWith(QLatin1String("--data-dir"))) {
+				data_dir = QUrl::fromPercentEncoding(args[i].section(u'=', 1).toUtf8());
+			} else if (args[i].startsWith(QLatin1String("--locale-dir"))) {
+				locale_dir = QUrl::fromPercentEncoding(args[i].section(u'=', 1).toUtf8());
+			} else if (args[i].startsWith(QLatin1String("--rkd-server-name"))) {
+				rkd_server_name = QUrl::fromPercentEncoding(args[i].section(u'=', 1).toUtf8());
 			} else if (args[i] == QLatin1String("--setup")) {
 				setup = true;
 			} else {
-				printf ("unknown argument %s", qPrintable (args[i]));
+				printf("unknown argument %s", qPrintable(args[i]));
 			}
 		}
-		if (servername.isEmpty ()) {
-			printf ("no server to connect to\n");
+		if (servername.isEmpty()) {
+			printf("no server to connect to\n");
 			return 1;
 		}
 		RK_DEBUG(RBACKEND, DL_DEBUG, "Qt version (runtime): %s", qVersion());
diff --git a/rkward/rbackend/rkrbackendprotocol_shared.cpp b/rkward/rbackend/rkrbackendprotocol_shared.cpp
index de18dbb31..11ef988c8 100644
--- a/rkward/rbackend/rkrbackendprotocol_shared.cpp
+++ b/rkward/rbackend/rkrbackendprotocol_shared.cpp
@@ -105,40 +105,40 @@ void RKROutputBuffer::pushOutputCapture (int capture_mode) {
 	output_captures.append (capture);
 }
 
-QString RKROutputBuffer::popOutputCapture (bool highlighted) {
-	RK_TRACE (RBACKEND);
+QString RKROutputBuffer::popOutputCapture(bool highlighted) {
+	RK_TRACE(RBACKEND);
 
-	if (output_captures.isEmpty ()) {
-		RK_ASSERT (!output_captures.isEmpty ());
-		return QString ();
+	if (output_captures.isEmpty()) {
+		RK_ASSERT(!output_captures.isEmpty());
+		return QString();
 	}
-	OutputCapture capture = output_captures.takeLast ();
-	if (capture.recorded.isEmpty ()) return QString ();
+	OutputCapture capture = output_captures.takeLast();
+	if (capture.recorded.isEmpty()) return QString();
 
 	QString ret;
 	ROutput::ROutputType previous_type = ROutput::NoOutput;
-	for (int i = 0; i < capture.recorded.length (); ++i) {
-		const ROutput * output = capture.recorded[i];
-		if (output->output.isEmpty ()) continue;
+	for (int i = 0; i < capture.recorded.length(); ++i) {
+		const ROutput* output = capture.recorded[i];
+		if (output->output.isEmpty()) continue;
 
-		if (output->type != ROutput::Error) {	// NOTE: skip error output. It has already been written as a warning.
+		if (output->type != ROutput::Error) {  // NOTE: skip error output. It has already been written as a warning.
 			if (highlighted && (output->type != previous_type)) {
-				if (!ret.isEmpty ()) ret.append ("</pre>\n");
+				if (!ret.isEmpty()) ret.append(u"</pre>\n"_s);
 
-				if (output->type == ROutput::Output) ret.append ("<pre class=\"output_normal\">");
-				else if (output->type == ROutput::Warning) ret.append ("<pre class=\"output_warning\">");
+				if (output->type == ROutput::Output) ret.append(u"<pre class=\"output_normal\">"_s);
+				else if (output->type == ROutput::Warning) ret.append(u"<pre class=\"output_warning\">"_s);
 				else {
-					RK_ASSERT (false);
-					ret.append ("<pre>");
+					RK_ASSERT(false);
+					ret.append(u"<pre>"_s);
 				}
 			}
-			if (highlighted) ret.append (output->output.toHtmlEscaped ());
-			else ret.append (output->output);
+			if (highlighted) ret.append(output->output.toHtmlEscaped());
+			else ret.append(output->output);
 
 			previous_type = output->type;
 		}
 	}
-	if (highlighted && !ret.isEmpty ()) ret.append ("</pre>\n");
+	if (highlighted && !ret.isEmpty()) ret.append(u"</pre>\n"_s);
 	return ret;
 }
 
@@ -214,17 +214,17 @@ ROutputList RKROutputBuffer::flushOutput (bool forcibly) {
 
 
 
-QString RKRSharedFunctionality::quote (const QString &string) {
+QString RKRSharedFunctionality::quote(const QString &string) {
 	QString ret;
-	int s = string.size ();
-	ret.reserve (s + 2);	// typical case: Only quotes added, no escapes needed.
-	ret.append ('\"');
+	int s = string.size();
+	ret.reserve(s + 2);  // typical case: Only quotes added, no escapes needed.
+	ret.append(u'\"');
 	for (int i = 0; i < s; ++i) {
 		const QChar c = string[i];
-		if ((c == '\\') || (c == '\"')) ret.append ('\\');
-		ret.append (c);
+		if ((c == u'\\') || (c == u'\"')) ret.append(u'\\');
+		ret.append(c);
 	}
-	ret.append ('\"');
+	ret.append(u'\"');
 
 	return ret;
 }
@@ -239,7 +239,7 @@ namespace RK_Debug {
 
 	bool setupLogFile (const QString &basename) {
 		QStringList all_debug_files (basename);
-		all_debug_files << basename + ".0" << basename + ".1";
+		all_debug_files << basename + u".0"_s << basename + u".1"_s;
 		for (int i = all_debug_files.size () -1; i >= 0; --i) {
 			QFile oldfile (all_debug_files[i]);
 			if (oldfile.exists ()) {
diff --git a/rkward/rbackend/rkrbackendprotocol_shared.h b/rkward/rbackend/rkrbackendprotocol_shared.h
index f9db15c05..22aae8237 100644
--- a/rkward/rbackend/rkrbackendprotocol_shared.h
+++ b/rkward/rbackend/rkrbackendprotocol_shared.h
@@ -12,6 +12,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
 #include <QMutex>
 #include "rcommand.h"
 
+using namespace Qt::Literals::StringLiterals;
 class RCommandProxy;
 
 /** Class to represent an "event" sent between backend and frontend. This encapuslates all communication sent between the two processes (actually the graphics device uses a separate channel, but that's not the point, here).
diff --git a/rkward/rbackend/rkrinterface.cpp b/rkward/rbackend/rkrinterface.cpp
index 4588b3de0..497a96018 100644
--- a/rkward/rbackend/rkrinterface.cpp
+++ b/rkward/rbackend/rkrinterface.cpp
@@ -89,9 +89,9 @@ RInterface::RInterface () {
 	auto fake_c = new RCommand(i18n("R Startup"), RCommand::App | RCommand::Sync | RCommand::ObjectListUpdate, i18n("R Startup"));
 	fake_c->whenFinished(this, [this](RCommand *command) {
 		if (startup_phase2_error || command->failed()) backend_error.message.append (i18n ("<p>\t-An unspecified error occurred that is not yet handled by RKWard. Likely RKWard will not function properly. Please check your setup.</p>\n"));
-		if (!backend_error.message.isEmpty ()) {
+		if (!backend_error.message.isEmpty()) {
 			backend_error.message.prepend (i18n ("<p>There was a problem starting the R backend. The following error(s) occurred:</p>\n"));
-			backend_error.details = command->fullOutput().replace('<', QLatin1String("<")).replace('\n', QLatin1String("<br>"));
+			backend_error.details = command->fullOutput().replace(u'<', u"<"_s).replace(u'\n', u"<br>"_s);
 			backend_error.title = i18n("Error starting R");
 			// reporting the error will happen via RKWardMainWindow, which calls the setup wizard in this case
 		}
@@ -254,7 +254,7 @@ void RInterface::handleCommandOut (RCommand *command) {
 		command->status |= RCommand::HasError;
 		ROutput *out = new ROutput;
 		out->type = ROutput::Error;
-		out->output = ("--- interrupted ---");
+		out->output = u"--- interrupted ---"_s;
 		command->output_list.append (out);
 		command->newOutput (out);
 	}
@@ -404,7 +404,7 @@ void RInterface::handleRequest (RBackendRequest* request) {
 		if (qEnvironmentVariableIsSet("APPDIR")) {
 			// Running inside an AppImage. As soon as R has started, it should behave as if running in the main (system) environment (esp. when calling helper binaries such as wget or gcc).
 			// Unset any paths starting with APPDIR, _except_ those inside R_HOME.
-			runStartupCommand(new RCommand("local({\n"
+			runStartupCommand(new RCommand(QStringLiteral("local({\n"
 			"	appdir <- Sys.getenv(\"APPDIR\")\n"
 			"	fix <- function(key) {\n"
 			"		paths <- strsplit(Sys.getenv(key), \":\", fixed=TRUE)[[1]]\n"
@@ -415,7 +415,7 @@ void RInterface::handleRequest (RBackendRequest* request) {
 			"	}\n"
 			"	fix(\"LD_LIBRARY_PATH\")\n"
 			"	fix(\"PATH\")\n"
-			"})\n", RCommand::App | RCommand::Sync), chain, [](RCommand*) {});
+			"})\n"), RCommand::App | RCommand::Sync), chain, [](RCommand*) {});
 		}
 
 		// find out about standard library locations
@@ -457,7 +457,7 @@ void RInterface::handleRequest (RBackendRequest* request) {
 		QString cd_to = RKSettingsModuleGeneral::initialWorkingDirectory();
 		if (cd_to.isEmpty()) cd_to = QDir::currentPath();
 		if (cd_to.isEmpty()) cd_to = QStringLiteral("."); // we must be in a non-existent dir. cd'ing to "." will cause us to sync with the backend
-		RInterface::issueCommand(new RCommand("setwd(" + RObject::rQuote(cd_to) + ")\n", RCommand::App | RCommand::Sync), chain);
+		RInterface::issueCommand(new RCommand(u"setwd("_s + RObject::rQuote(cd_to) + u")\n"_s, RCommand::App | RCommand::Sync), chain);
 	} else {
 		processRBackendRequest (request);
 	}
@@ -599,7 +599,7 @@ GenericRRequestResult RInterface::processRCallRequest (const QString &call, cons
 		QVariantList al = args.toList();  // added, removed, changed
 		RObjectList::getGlobalEnv()->updateFromR(in_chain, al.value(0).toStringList(), al.value(1).toStringList());
 		QStringList changed = al.value(2).toStringList();
-		RK_DEBUG(RBACKEND, DL_DEBUG, "symbols added %s, removed %s, changed %s", qPrintable(al.value(0).toStringList().join(",")), qPrintable(al.value(1).toStringList().join(",")), qPrintable(al.value(2).toStringList().join(",")));
+		RK_DEBUG(RBACKEND, DL_DEBUG, "symbols added %s, removed %s, changed %s", qPrintable(al.value(0).toStringList().join(u","_s)), qPrintable(al.value(1).toStringList().join(u","_s)), qPrintable(al.value(2).toStringList().join(u","_s)));
 		for (int i = 0; i < changed.count (); ++i) {
 			QString object_name = changed[i];
 			RObject *obj = RObjectList::getObjectList ()->findObject (object_name);
@@ -674,7 +674,7 @@ GenericRRequestResult RInterface::processRCallRequest (const QString &call, cons
 		QDir::setCurrent(arglist.value(0));
 		Q_EMIT backendWorkdirChanged();
 	} else if (call == QLatin1String("highlightRCode")) {
-		return GenericRRequestResult(RKCommandHighlighter::commandToHTML(arglist.join('\n')));
+		return GenericRRequestResult(RKCommandHighlighter::commandToHTML(arglist.join(u'\n')));
 	} else if (call == QLatin1String("quit")) {
 		RKWardMainWindow::getMain()->close();
 		// if we're still alive, quitting was canceled
@@ -723,7 +723,7 @@ GenericRRequestResult RInterface::processRCallRequest (const QString &call, cons
 		QFileDialog d(nullptr, arglist.value(0));  // caption
 		QString initial = arglist.value(1);
 		QString cat;
-		if (initial.startsWith('#')) {
+		if (initial.startsWith(u'#')) {
 			cat = initial.mid(1);
 			initial = QFileInfo(RKRecentUrls::mostRecentUrl(cat).toLocalFile()).absolutePath();
 		}
@@ -731,7 +731,7 @@ GenericRRequestResult RInterface::processRCallRequest (const QString &call, cons
 		d.setDirectory(initial);
 		QString filter = arglist.value(2);
 		if (!filter.isEmpty()) {
-			if (!filter.contains('(')) filter += '(' + filter + ')';
+			if (!filter.contains(u'(')) filter += u'(' + filter + u')';
 			d.setNameFilter(filter);
 		}
 		QString mode = arglist.value(3);
@@ -765,7 +765,7 @@ GenericRRequestResult RInterface::processRCallRequest (const QString &call, cons
 			QStringList list = arglist.mid(2);
 			RKWorkplace::mainWorkplace()->restoreWorkplace(list);
 		} else {
-			RK_ASSERT(arglist.value(0) == "get");
+			RK_ASSERT(arglist.value(0) == "get"_L1);
 			return GenericRRequestResult(RKWorkplace::mainWorkplace()->makeWorkplaceDescription());
 		}
 	} else if (call == QLatin1String("set.window.placement.hint")) {
diff --git a/rkward/rbackend/rkrsupport.cpp b/rkward/rbackend/rkrsupport.cpp
index d18b517e0..c4886dca3 100644
--- a/rkward/rbackend/rkrsupport.cpp
+++ b/rkward/rbackend/rkrsupport.cpp
@@ -378,9 +378,9 @@ RKRShadowEnvironment::Result RKRShadowEnvironment::diffAndUpdate() {
 	}
 	RFn::Rf_unprotect(1);  // symbols2
 
-	RK_DEBUG(RBACKEND, DL_DEBUG, "added %s\n", qPrintable(res.added.join(", ")));
-	RK_DEBUG(RBACKEND, DL_DEBUG, "changed %s\n", qPrintable(res.changed.join(", ")));
-	RK_DEBUG(RBACKEND, DL_DEBUG, "removed %s\n", qPrintable(res.removed.join(", ")));
+	RK_DEBUG(RBACKEND, DL_DEBUG, "added %s\n", qPrintable(res.added.join(u", "_s)));
+	RK_DEBUG(RBACKEND, DL_DEBUG, "changed %s\n", qPrintable(res.changed.join(u", "_s)));
+	RK_DEBUG(RBACKEND, DL_DEBUG, "removed %s\n", qPrintable(res.removed.join(u", "_s)));
 	return res;
 }
 
diff --git a/rkward/rbackend/rksessionvars.cpp b/rkward/rbackend/rksessionvars.cpp
index 7e6057c39..a1f5fab96 100644
--- a/rkward/rbackend/rksessionvars.cpp
+++ b/rkward/rbackend/rksessionvars.cpp
@@ -26,7 +26,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
 #include "../debug.h"
 
 RKSessionVars* RKSessionVars::_instance = nullptr;
-RKParsedVersion RKSessionVars::rkward_version(RKWARD_VERSION);
+RKParsedVersion RKSessionVars::rkward_version(QStringLiteral(RKWARD_VERSION));
 RKParsedVersion RKSessionVars::r_version;
 QString RKSessionVars::r_version_string;
 QString RKSessionVars::r_binary;
@@ -71,7 +71,7 @@ void RKSessionVars::setRVersion (const QString& version_string) {
 
 QString RKSessionVars::RVersion(bool abbridged) {
 	if (!abbridged) return r_version_string;
-	return r_version_string.section ('.', 0, 1);
+	return r_version_string.section (u'.', 0, 1);
 }
 
 int RKSessionVars::compareRKWardVersion (const QString& version) {
@@ -90,35 +90,35 @@ int RKSessionVars::compareRVersion (const QString& version) {
 	return 0;
 }
 
-QStringList RKSessionVars::frontendSessionInfo () {
+QStringList RKSessionVars::frontendSessionInfo() {
 	// NOTE: No translation on purpose. This is mostly meant for pasting to the bug tracker
 	QStringList lines;
-	lines.append ("RKWard version: " RKWARD_VERSION);
-	lines.append ("KDE Frameworks version (runtime): " + QString (KCoreAddons::versionString ()));
-	lines.append ("KDE Frameworks version (compile time): " KCOREADDONS_VERSION_STRING);
-	lines.append (QStringLiteral ("Qt version (runtime): ") + qVersion ());
-	lines.append ("Qt version (compile time): " QT_VERSION_STR);
-	lines.append (QStringLiteral("Using QWebEngine for HTML rendering"));
+	lines.append(QStringLiteral("RKWard version: " RKWARD_VERSION));
+	lines.append(u"KDE Frameworks version (runtime): "_s + QString(KCoreAddons::versionString()));
+	lines.append(QStringLiteral("KDE Frameworks version (compile time): " KCOREADDONS_VERSION_STRING));
+	lines.append(QStringLiteral("Qt version (runtime): ") + QString::fromLatin1(qVersion()));
+	lines.append(QStringLiteral("Qt version (compile time): " QT_VERSION_STR));
+	lines.append(QStringLiteral("Using QWebEngine for HTML rendering"));
 	lines.append(QStringLiteral("Running on: ") + QSysInfo::prettyProductName());
-	lines.append ("Local config directory: " + QStandardPaths::writableLocation (QStandardPaths::GenericConfigLocation));
-	lines.append ("RKWard storage directory: " + RKSettingsModuleGeneral::filesPath ());
-	lines.append ("Backend version (as known to the frontend): " + r_version_string);
-	lines.append (QString());
-	lines.append (QStringLiteral("Debug message file (this may contain relevant diagnostic output in case of trouble):"));
-	lines.append (RK_Debug::debug_file->fileName ());
+	lines.append(u"Local config directory: "_s + QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation));
+	lines.append(u"RKWard storage directory: "_s + RKSettingsModuleGeneral::filesPath());
+	lines.append(u"Backend version (as known to the frontend): "_s + r_version_string);
+	lines.append(QString());
+	lines.append(QStringLiteral("Debug message file (this may contain relevant diagnostic output in case of trouble):"));
+	lines.append(RK_Debug::debug_file->fileName());
 	return lines;
 }
 
 #if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
-static QString findExeAtPath (const QString &appname, const QString &path) {
-	QDir dir (path);
-	dir.makeAbsolute ();
-	if (QFileInfo (dir.filePath (appname)).isExecutable ()) return dir.filePath (appname);
+static QString findExeAtPath(const QString &appname, const QString &path) {
+	QDir dir(path);
+	dir.makeAbsolute();
+	if (QFileInfo(dir.filePath(appname)).isExecutable()) return dir.filePath(appname);
 #ifdef Q_OS_WIN
-	if (QFileInfo (dir.filePath (appname + ".exe")).isExecutable ()) return dir.filePath (appname + ".exe");
-	if (QFileInfo (dir.filePath (appname + ".com")).isExecutable ()) return dir.filePath (appname + ".com");
+	if (QFileInfo(dir.filePath(appname + u".exe"_s)).isExecutable()) return dir.filePath(appname + u".exe"_s);
+	if (QFileInfo(dir.filePath(appname + u".com"_s)).isExecutable()) return dir.filePath(appname + u".com"_s);
 #endif
-	return QString ();
+	return QString();
 }
 
 /** glob dirs instroot/prefix-* /rpath, sorted by version number represented in "*" */
@@ -126,8 +126,8 @@ static QStringList globVersionedDirs(const QString &instroot, const QString &pre
 	QStringList ret;
 	if (QFileInfo(instroot).isReadable()) {
 		QDir dir(instroot);
-		QStringList candidates = dir.entryList(QStringList(prefix + "*"), QDir::Dirs);
-		std::sort(candidates.begin(), candidates.end(), [prefix](const QString&a, const QString& b) -> bool {
+		QStringList candidates = dir.entryList(QStringList(prefix + u"*"_s), QDir::Dirs);
+		std::sort(candidates.begin(), candidates.end(), [prefix](const QString &a, const QString &b) -> bool {
 			return QVersionNumber::fromString(a.mid(prefix.length())) > QVersionNumber::fromString(b.mid(prefix.length()));
 		});
 		for (int i = 0; i < candidates.count(); ++i) {
@@ -142,13 +142,13 @@ static QStringList globVersionedDirs(const QString &instroot, const QString &pre
 QStringList RKSessionVars::findRInstallations() {
 	QStringList ret;
 #if defined(Q_OS_MACOS)
-	ret = globVersionedDirs("/Library/Frameworks/R.framework/Versions", QString(), "Resources/bin/R");
+	ret = globVersionedDirs(u"/Library/Frameworks/R.framework/Versions"_s, QString(), u"Resources/bin/R"_s);
 #elif defined(Q_OS_WIN)
-	QString instroot = QString(getenv("PROGRAMFILES")) + "/R";
-	if (!QFileInfo(instroot).isReadable()) instroot = QString(getenv("PROGRAMFILES(x86)")) + "/R";
-	ret = globVersionedDirs(instroot, "R-", "bin/R");
+	QString instroot = QString(getenv("PROGRAMFILES")) + u"/R"_s;
+	if (!QFileInfo(instroot).isReadable()) instroot = QString(getenv("PROGRAMFILES(x86)")) + u"/R"_s;
+	ret = globVersionedDirs(instroot, u"R-"_s, u"bin/R"_s);
 #else
-	const QStringList candidates{"/usr/bin/R", "/usr/local/bin/R"};
+	const QStringList candidates{u"/usr/bin/R"_s, u"/usr/local/bin/R"_s};
 	for(const QString &p : candidates) {
 		if (!ret.contains(p) && QFileInfo(p).isExecutable()) ret.append(p);
 	}
diff --git a/rkward/rbackend/rkstructuregetter.cpp b/rkward/rbackend/rkstructuregetter.cpp
index dbefc8459..de0ae4ab5 100644
--- a/rkward/rbackend/rkstructuregetter.cpp
+++ b/rkward/rbackend/rkstructuregetter.cpp
@@ -199,15 +199,15 @@ void RKStructureGetter::getStructureWorker (SEXP val, const QString &name, int a
 			if (RFn::TYPEOF (value) == LANGSXP) {
 				SEXP symb = RFn::Rf_protect (RFn::CAR (value));
 				QString cl;
-				if (RFn::TYPEOF (symb) == SYMSXP) cl = RFn::R_CHAR(RFn::PRINTNAME (symb));
+				if (RFn::TYPEOF (symb) == SYMSXP) cl = RKTextCodec::fromNative(RFn::R_CHAR(RFn::PRINTNAME (symb)));
 				RFn::Rf_unprotect (1);
 				if ((cl != QLatin1String("if")) && (cl != QLatin1String("while")) && (cl != QLatin1String("for")) && (cl != QLatin1String("=")) && (cl != QLatin1String("<-")) && (cl != QLatin1String("(")) && (cl != QLatin1String("{"))) cl = QLatin1String("call");
-				classes = QStringList (cl);
+				classes = QStringList(cl);
                         } else if (RFn::TYPEOF (value) == BCODESXP) {
 				value = ROb(R_NilValue);   // This is a bit lame, but bytecode cannot be cast to expression, below, and no idea what else to do with it (or what info to extract, anyway)
-				classes = QStringList("bytecode");
+				classes = QStringList(u"bytecode"_s);
 			} else {
-				classes = QStringList ("name");
+				classes = QStringList(u"name"_s);
 			}
 		}
 
diff --git a/rkward/rbackend/rktransmitter.cpp b/rkward/rbackend/rktransmitter.cpp
index 851352759..7b6149fba 100644
--- a/rkward/rbackend/rktransmitter.cpp
+++ b/rkward/rbackend/rktransmitter.cpp
@@ -209,44 +209,44 @@ RKAbstractTransmitter::~RKAbstractTransmitter() {
 	_instance = nullptr;
 }
 
-void RKAbstractTransmitter::transmitRequest (RBackendRequest *request) {
-	RK_TRACE (RBACKEND);
-	RK_ASSERT (connection);
+void RKAbstractTransmitter::transmitRequest(RBackendRequest *request) {
+	RK_TRACE(RBACKEND);
+	RK_ASSERT(connection);
 
-	if (!connection->isOpen ()) {
-		handleTransmissionError ("Connection not open while trying to write request. Last error was: " + connection->errorString ());
+	if (!connection->isOpen()) {
+		handleTransmissionError(u"Connection not open while trying to write request. Last error was: "_s + connection->errorString());
 		return;
 	}
 
-	RKRBackendSerializer::serialize (*request, streamer.outstream);
-	RK_DEBUG (RBACKEND, DL_DEBUG, "Transmitting request type %d of length %d", (int) request->type, streamer.outSize ());
-	streamer.writeOutBuffer ();
+	RKRBackendSerializer::serialize(*request, streamer.outstream);
+	RK_DEBUG(RBACKEND, DL_DEBUG, "Transmitting request type %d of length %d", (int)request->type, streamer.outSize());
+	streamer.writeOutBuffer();
 }
 
-void RKAbstractTransmitter::customEvent (QEvent *e) {
-	RK_TRACE (RBACKEND);
+void RKAbstractTransmitter::customEvent(QEvent *e) {
+	RK_TRACE(RBACKEND);
 
-	if (((int) e->type ()) == ((int) RKRBackendEvent::RKWardEvent)) {
-		RKRBackendEvent *ev = static_cast<RKRBackendEvent*> (e);
-		writeRequest (ev->data ());
+	if (((int)e->type()) == ((int)RKRBackendEvent::RKWardEvent)) {
+		RKRBackendEvent *ev = static_cast<RKRBackendEvent *>(e);
+		writeRequest(ev->data());
 	} else {
-		RK_ASSERT (false);
+		RK_ASSERT(false);
 		return;
 	}
 }
 
-void RKAbstractTransmitter::fetchTransmission () {
-	RK_TRACE (RBACKEND);
+void RKAbstractTransmitter::fetchTransmission() {
+	RK_TRACE(RBACKEND);
 
-	while (connection->bytesAvailable ()) {
-		if (!streamer.readInBuffer ()) break;
+	while (connection->bytesAvailable()) {
+		if (!streamer.readInBuffer()) break;
 
-		requestReceived (RKRBackendSerializer::unserialize (streamer.instream));
-		RK_ASSERT (streamer.instream.atEnd ());   // full transmission should have been read
+		requestReceived(RKRBackendSerializer::unserialize(streamer.instream));
+		RK_ASSERT(streamer.instream.atEnd());  // full transmission should have been read
 	}
 
-	if (!connection->isOpen ()) {
-		handleTransmissionError ("Connection closed unexepctedly. Last error was: " + connection->errorString ());
+	if (!connection->isOpen()) {
+		handleTransmissionError(u"Connection closed unexepctedly. Last error was: "_s + connection->errorString());
 		return;
 	}
 }
@@ -266,10 +266,9 @@ void RKAbstractTransmitter::setConnection (QLocalSocket *_connection) {
 	if (connection->bytesAvailable ()) QTimer::singleShot(0, this, &RKAbstractTransmitter::fetchTransmission);
 }
 
-void RKAbstractTransmitter::disconnected () {
-	RK_TRACE (RBACKEND);
+void RKAbstractTransmitter::disconnected() {
+	RK_TRACE(RBACKEND);
 
 	if (!connection) return;  // -> May happen in RKRBackendTransmitter::doExit()
-	handleTransmissionError ("Connection closed unexpectedly. Last error was: " + connection->errorString ());
+	handleTransmissionError(u"Connection closed unexpectedly. Last error was: "_s + connection->errorString());
 }
-
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
index e3c09123f..3be1295c4 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
@@ -24,6 +24,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "../../debug.h"
 
+using namespace Qt::Literals::StringLiterals;
+
 #define UPDATE_INTERVAL 100
 
 QHash<int, RKGraphicsDevice*> RKGraphicsDevice::devices;
@@ -193,11 +195,12 @@ void RKGraphicsDevice::updateNow () {
 }
 
 void RKGraphicsDevice::checkSize() {
-	RK_TRACE (GRAPHICS_DEVICE);
-	if(!view) return;
-	if (view->size () != area.size ()) {
-		if(view->size().isEmpty()) return;
-		RInterface::issueCommand(new RCommand ("rkward:::RK.resize(" + QString::number(devices.key(this) + 1) + ',' + QString::number(id) + ')', RCommand::PriorityCommand));
+	RK_TRACE(GRAPHICS_DEVICE);
+	if (!view) return;
+	if (view->size() != area.size()) {
+		if (view->size().isEmpty()) return;
+		RInterface::issueCommand(
+		    new RCommand(u"rkward:::RK.resize("_s + QString::number(devices.key(this) + 1) + u',' + QString::number(id) + u')', RCommand::PriorityCommand));
 	}
 }
 
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
index e403bb217..0e37e3a54 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
@@ -42,14 +42,14 @@ RKGraphicsDeviceFrontendTransmitter::~RKGraphicsDeviceFrontendTransmitter () {
 	if (local_server->isListening ()) local_server->close ();
 }
 
-void RKGraphicsDeviceFrontendTransmitter::setupServer () {
-	RK_TRACE (GRAPHICS_DEVICE);
+void RKGraphicsDeviceFrontendTransmitter::setupServer() {
+	RK_TRACE(GRAPHICS_DEVICE);
 
-	RK_ASSERT (!local_server);
+	RK_ASSERT(!local_server);
 	local_server = new QLocalServer(this);
-	RK_ASSERT (local_server->listen ("rkd" + KRandom::randomString (8)));
-	connect (local_server, &QLocalServer::newConnection, this, &RKGraphicsDeviceFrontendTransmitter::newConnection);
-	server_name = local_server->fullServerName ();
+	RK_ASSERT(local_server->listen(u"rkd"_s + KRandom::randomString(8)));
+	connect(local_server, &QLocalServer::newConnection, this, &RKGraphicsDeviceFrontendTransmitter::newConnection);
+	server_name = local_server->fullServerName();
 }
 
 void RKGraphicsDeviceFrontendTransmitter::newConnection () {
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
index bd11df00b..d75ac0be1 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
@@ -16,6 +16,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
 #include "../rkreventloop.h"
 #include "../../debug.h"
 
+using namespace Qt::Literals::StringLiterals;
+
 #undef RK_TRACE
 #define RK_TRACE(flags)
 /*
@@ -178,7 +180,7 @@ public:
 	RKD_OUT_STREAM << (qint8) ColorFill; WRITE_COLOR_BYTES (gc->fill);
 #endif
 #define WRITE_FONT(dev) \
-	RKD_OUT_STREAM << gc->cex << gc->ps << gc->lineheight << (quint8) gc->fontface << (gc->fontfamily[0] ? QString (gc->fontfamily) : (static_cast<RKGraphicsDeviceDesc*> (dev->deviceSpecific)->getFontFamily (gc->fontface == 5)))
+	RKD_OUT_STREAM << gc->cex << gc->ps << gc->lineheight << (quint8) gc->fontface << (gc->fontfamily[0] ? QString::fromUtf8(gc->fontfamily) : (static_cast<RKGraphicsDeviceDesc *>(dev->deviceSpecific)->getFontFamily(gc->fontface == 5)))
 
 static void RKD_QueryResolution (double *dpix, double *dpiy) {
 	RK_TRACE(GRAPHICS_DEVICE);
@@ -529,7 +531,7 @@ static Rboolean RKD_NewFrameConfirm (pDevDesc dev) {
 	// Return value FALSE: Let R ask, instead
 }
 
-void RKD_EventHelper (pDevDesc dev, int code) {
+void RKD_EventHelper(pDevDesc dev, int code) {
 	RK_TRACE(GRAPHICS_DEVICE);
 	{
 		RKGraphicsDataStreamWriteGuard wguard;
@@ -539,17 +541,17 @@ void RKD_EventHelper (pDevDesc dev, int code) {
 				SEXP sprompt = RFn::Rf_findVar(RFn::Rf_install("prompt"), dev->eventEnv);
 				if (RFn::Rf_length(sprompt) == 1) prompt = QString::fromUtf8(RFn::R_CHAR(RFn::Rf_asChar(sprompt)));
 			}
-			WRITE_HEADER (RKDStartGettingEvents, dev);
+			WRITE_HEADER(RKDStartGettingEvents, dev);
 			RKD_OUT_STREAM << prompt;
 			return;
 		} else if (code == 0) {
-			WRITE_HEADER (RKDStopGettingEvents, dev);
+			WRITE_HEADER(RKDStopGettingEvents, dev);
 			return;
 		} else {
-			WRITE_HEADER (RKDFetchNextEvent, dev);
+			WRITE_HEADER(RKDFetchNextEvent, dev);
 		}
 	}
-	RK_ASSERT (code == 2);
+	RK_ASSERT(code == 2);
 
 	// NOTE: The event handler functions doKeybd() and doMouseEvent() could conceivably produce errors -> longjump
 	// Thus we need to make sure the read-guard has gone out of scope before that. Thus, we take the somewhat clunky
@@ -572,20 +574,21 @@ void RKD_EventHelper (pDevDesc dev, int code) {
 	}
 
 	if (event_code == RKDFrontendCancel) {
-		RFn::Rf_error ("Interrupted by user");
+		RFn::Rf_error("Interrupted by user");
 		return;  // not reached
 	}
 	if (event_code == RKDNothing) {
 		if (RFn::Rf_doesIdle(dev)) RFn::Rf_doIdle(dev);
 		return;
 	} else if (event_code == RKDKeyPress) {
-		if (modifiers - (modifiers & Qt::ShiftModifier)) {  // any other modifier than Shift, alone. NOTE: devX11.c and devWindows.c handle Ctrl, only as of R 3.0.0
+		if (modifiers -
+		    (modifiers & Qt::ShiftModifier)) {  // any other modifier than Shift, alone. NOTE: devX11.c and devWindows.c handle Ctrl, only as of R 3.0.0
 			QString mod_text;
-			if (modifiers & Qt::ControlModifier) mod_text.append ("ctrl-");
-			if (modifiers & Qt::AltModifier) mod_text.append ("alt-");
-			if (modifiers & Qt::MetaModifier) mod_text.append ("meta-");
-			if (text.isEmpty () && (modifiers & Qt::ShiftModifier)) mod_text.append ("shift-");     // don't apply shift when there is text (where it has already been handled)
-			text = mod_text + text.toUpper ();
+			if (modifiers & Qt::ControlModifier) mod_text.append(u"ctrl-"_s);
+			if (modifiers & Qt::AltModifier) mod_text.append(u"alt-"_s);
+			if (modifiers & Qt::MetaModifier) mod_text.append(u"meta-"_s);
+			if (text.isEmpty() && (modifiers & Qt::ShiftModifier)) mod_text.append(u"shift-"_s);  // don't apply shift when there is text (where it has already been handled)
+			text = mod_text + text.toUpper();
 		}
 
 		R_KeyName r_key_name = R_KeyName::knUNKNOWN;
@@ -593,7 +596,7 @@ void RKD_EventHelper (pDevDesc dev, int code) {
 		else if (keycode == Qt::Key_Right) r_key_name = R_KeyName::knRIGHT;
 		else if (keycode == Qt::Key_Up) r_key_name = R_KeyName::knUP;
 		else if (keycode == Qt::Key_Down) r_key_name = R_KeyName::knDOWN;
-		else if ((keycode >= Qt::Key_F1) && (keycode <= Qt::Key_F12)) r_key_name = (R_KeyName) (R_KeyName::knF1 + (keycode - Qt::Key_F1));
+		else if ((keycode >= Qt::Key_F1) && (keycode <= Qt::Key_F12)) r_key_name = (R_KeyName)(R_KeyName::knF1 + (keycode - Qt::Key_F1));
 		else if (keycode == Qt::Key_PageUp) r_key_name = R_KeyName::knPGUP;
 		else if (keycode == Qt::Key_PageDown) r_key_name = R_KeyName::knPGDN;
 		else if (keycode == Qt::Key_End) r_key_name = R_KeyName::knEND;
@@ -601,9 +604,11 @@ void RKD_EventHelper (pDevDesc dev, int code) {
 		else if (keycode == Qt::Key_Insert) r_key_name = R_KeyName::knINS;
 		else if (keycode == Qt::Key_Delete) r_key_name = R_KeyName::knDEL;
 
-		RFn::Rf_doKeybd(dev, r_key_name, text.toUtf8 ().data());
-	} else {    // all others are mouse events
-		RFn::Rf_doMouseEvent(dev, event_code == RKDMouseDown ? R_MouseEvent::meMouseDown : (event_code == RKDMouseUp ? R_MouseEvent::meMouseUp : R_MouseEvent::meMouseMove), buttons, x, y);
+		RFn::Rf_doKeybd(dev, r_key_name, text.toUtf8().data());
+	} else {  // all others are mouse events
+		RFn::Rf_doMouseEvent(
+		    dev, event_code == RKDMouseDown ? R_MouseEvent::meMouseDown : (event_code == RKDMouseUp ? R_MouseEvent::meMouseUp : R_MouseEvent::meMouseMove),
+		    buttons, x, y);
 	}
 }
 
@@ -942,9 +947,9 @@ void RKD_Glyph(int n, int *glyphs, double *x, double *y, SEXP font, double size,
 		RKGraphicsDataStreamWriteGuard guard;
 		WRITE_HEADER(RKDGlyph, dev);
 
-		QString qfont = QString(RFn::R_GE_glyphFontFile(font));
+		QString qfont = QString::fromUtf8(RFn::R_GE_glyphFontFile(font));
 		quint8 index = RFn::R_GE_glyphFontIndex(font);
-		QString family = QString(RFn::R_GE_glyphFontFamily(font));
+		QString family = QString::fromUtf8(RFn::R_GE_glyphFontFamily(font));
 		quint32 weight = RFn::R_GE_glyphFontWeight(font);
 		quint8 style = mapTextStyle(RFn::R_GE_glyphFontStyle(font));
 		// NOTE: family, weight, and style are used as fallback, if font(-file), and index don't work
diff --git a/rkward/rkconsole.cpp b/rkward/rkconsole.cpp
index 1ea886002..79b3ba047 100644
--- a/rkward/rkconsole.cpp
+++ b/rkward/rkconsole.cpp
@@ -330,15 +330,15 @@ bool RKConsole::handleKeyPress (QKeyEvent *e) {
 	return false;
 }
 
-QString RKConsole::provideContext (int line_rev) {
-	RK_TRACE (COMMANDEDITOR);
+QString RKConsole::provideContext(int line_rev) {
+	RK_TRACE(COMMANDEDITOR);
 
 	QString ret;
-	if (line_rev == 0) ret = currentEditingLine ().left (currentCursorPositionInCommand ()); 
-	else if (!incomplete_command.isEmpty ()) {
-		QStringList lines = incomplete_command.split ('\n');
-		if (lines.size () > line_rev) {
-			ret = lines[lines.size () - line_rev - 1];
+	if (line_rev == 0) ret = currentEditingLine().left(currentCursorPositionInCommand());
+	else if (!incomplete_command.isEmpty()) {
+		QStringList lines = incomplete_command.split(u'\n');
+		if (lines.size() > line_rev) {
+			ret = lines[lines.size() - line_rev - 1];
 		}
 	}
 	return ret;
@@ -440,15 +440,15 @@ void RKConsole::cursorAtTheBeginning () {
 	view->setCursorPosition (KTextEditor::Cursor (doc->lines() - 1, prefix.length ()));
 }
 
-void RKConsole::submitCommand () {
-	RK_TRACE (APP);
+void RKConsole::submitCommand() {
+	RK_TRACE(APP);
 
-	QString command = incomplete_command + currentEditingLine ();
-	if (!input_buffer.isEmpty ()) {
-		int last_line_end = input_buffer.lastIndexOf ('\n');
+	QString command = incomplete_command + currentEditingLine();
+	if (!input_buffer.isEmpty()) {
+		int last_line_end = input_buffer.lastIndexOf(u'\n');
 		if (last_line_end < 0) {
 			last_line_end = 0;
-			RK_ASSERT (false);
+			RK_ASSERT(false);
 		}
 		command.append(QStringView{input_buffer}.left(last_line_end));
 		if (last_line_end < (input_buffer.size() - 1)) {
@@ -457,19 +457,20 @@ void RKConsole::submitCommand () {
 			input_buffer.clear();
 		}
 	} else {
-		RK_ASSERT (!command.endsWith ('\n'));
-		command.append ('\n');
+		RK_ASSERT(!command.endsWith(u'\n'));
+		command.append(u'\n');
 	}
 
-	current_command_displayed_up_to = incomplete_command.length ();
-	setCurrentEditingLine (command.mid (current_command_displayed_up_to, command.indexOf ('\n', current_command_displayed_up_to) - current_command_displayed_up_to));
-	current_command_displayed_up_to += currentEditingLine ().length ();
-	skip_command_display_lines = incomplete_command.count ('\n') + 1;	// incomplete command, and first line have already been shown.
+	current_command_displayed_up_to = incomplete_command.length();
+	setCurrentEditingLine(
+	    command.mid(current_command_displayed_up_to, command.indexOf(u'\n', current_command_displayed_up_to) - current_command_displayed_up_to));
+	current_command_displayed_up_to += currentEditingLine().length();
+	skip_command_display_lines = incomplete_command.count(u'\n') + 1;  // incomplete command, and first line have already been shown.
 
-	doc->insertLine (doc->lines (), QString ());
+	doc->insertLine(doc->lines(), QString());
 	output_cursor = doc->documentEnd();
-	if (!command.isEmpty ()) {
-		current_command = new RCommand (command, RCommand::User | RCommand::Console);
+	if (!command.isEmpty()) {
+		current_command = new RCommand(command, RCommand::User | RCommand::Console);
 		connect(current_command->notifier(), &RCommandNotifier::commandOutput, this, &RKConsole::newOutput);
 		connect(current_command->notifier(), &RCommandNotifier::commandLineIn, this, &RKConsole::userCommandLineIn);
 		current_command->whenFinished(this, [this](RCommand *command) {
@@ -491,11 +492,11 @@ void RKConsole::submitCommand () {
 			showPrompt();
 			tryNextInBuffer();
 		});
-		RInterface::issueCommand (current_command);
-		interrupt_command_action->setEnabled (true);
+		RInterface::issueCommand(current_command);
+		interrupt_command_action->setEnabled(true);
 	} else {
-		showPrompt ();
-		tryNextInBuffer ();
+		showPrompt();
+		tryNextInBuffer();
 	}
 }
 
@@ -523,12 +524,12 @@ void RKConsole::rawWriteLine(const QString& line, QChar line_end) {
 	}
 	doc->insertText(output_cursor, line);
 	output_cursor.setColumn(output_cursor.column() + line.length());
-	if (line_end == '\n') {
+	if (line_end == u'\n') {
 		output_cursor.setColumn(doc->lineLength(output_cursor.line()));
 		doc->insertText(output_cursor, QStringLiteral("\n"));
 		output_cursor.setColumn(0);
 		output_cursor.setLine(output_cursor.line() + 1);
-	} else if (line_end == '\r') {
+	} else if (line_end == u'\r') {
 		output_cursor.setColumn(0);
 	}
 }
@@ -549,12 +550,12 @@ void RKConsole::newOutput (RCommand *command, const ROutput *output) {
 	int end_pos = out.length();
 	while (++string_pos < end_pos) {
 		auto c = out.at(string_pos);
-		if (c == '\n' || c == '\r') {
+		if (c == u'\n' || c == u'\r') {
 			rawWriteLine(out.mid(start_pos, string_pos - start_pos), c);
 			start_pos = string_pos+1;
 		}
 	}
-	if (start_pos < end_pos) rawWriteLine(out.mid(start_pos, string_pos - start_pos + 1), ' ');
+	if (start_pos < end_pos) rawWriteLine(out.mid(start_pos, string_pos - start_pos + 1), u' ');
 
 	int end_line = output_cursor.line();
 	if (output->type != ROutput::Output || (!command)) {
@@ -578,20 +579,20 @@ void RKConsole::newOutput (RCommand *command, const ROutput *output) {
 	cursorAtTheEnd ();
 }
 
-void RKConsole::userCommandLineIn (RCommand* cmd) {
-	RK_TRACE (APP);
-	RK_ASSERT (cmd == current_command);
+void RKConsole::userCommandLineIn(RCommand* cmd) {
+	RK_TRACE(APP);
+	RK_ASSERT(cmd == current_command);
 
 	if (--skip_command_display_lines >= 0) return;
 
-	QString line = cmd->command ().mid (current_command_displayed_up_to + 1);
-	line = line.section ('\n', 0, 0) + '\n';
-	current_command_displayed_up_to += line.length ();
-	if (line.length () < 2) return;		// omit empty lines (esp. the trailing newline of the command!)
+	QString line = cmd->command().mid(current_command_displayed_up_to + 1);
+	line = line.section(u'\n', 0, 0) + u'\n';
+	current_command_displayed_up_to += line.length();
+	if (line.length() < 2) return;  // omit empty lines (esp. the trailing newline of the command!)
 
 	prefix = iprefix;
-	showPrompt ();
-	setCurrentEditingLine (line);
+	showPrompt();
+	setCurrentEditingLine(line);
 	output_cursor = doc->documentEnd();
 }
 
@@ -631,19 +632,19 @@ void RKConsole::showPrompt () {
 	cursorAtTheEnd ();
 }
 
-void RKConsole::tryNextInBuffer () {
-	RK_TRACE (APP);
+void RKConsole::tryNextInBuffer() {
+	RK_TRACE(APP);
 
-	if (!input_buffer.isEmpty ()) {
-		if (input_buffer.contains ('\n')) {
-			submitCommand ();	// will submit and clear the buffer
+	if (!input_buffer.isEmpty()) {
+		if (input_buffer.contains(u'\n')) {
+			submitCommand();  // will submit and clear the buffer
 			return;
 		} else {
-			setCurrentEditingLine (currentEditingLine () + input_buffer);
-			input_buffer.clear ();
+			setCurrentEditingLine(currentEditingLine() + input_buffer);
+			input_buffer.clear();
 		}
 	}
-	interrupt_command_action->setEnabled (!incomplete_command.isEmpty ());
+	interrupt_command_action->setEnabled(!incomplete_command.isEmpty());
 }
 
 bool RKConsole::isBusy () const {
@@ -672,67 +673,70 @@ void RKConsole::setCommandHistory (const QStringList &new_history, bool append)
 	commands_history.setHistory (new_history, append);
 }
 
-void RKConsole::userLoadHistory (const QUrl &_url) {
-	RK_TRACE (APP);
+void RKConsole::userLoadHistory(const QUrl &_url) {
+	RK_TRACE(APP);
 
 	QUrl url = _url;
-	if (url.isEmpty ()) {
-		url = QFileDialog::getOpenFileUrl (this, i18n ("Select command history file to load"), RKRecentUrls::mostRecentUrl(RKRecentUrls::scriptsId()).adjusted(QUrl::RemoveFilename), i18n ("R history files [*.Rhistory](*.Rhistory);;All files [*](*)"));
-		if (url.isEmpty ()) return;
+	if (url.isEmpty()) {
+		url = QFileDialog::getOpenFileUrl(this, i18n("Select command history file to load"),
+		                                  RKRecentUrls::mostRecentUrl(RKRecentUrls::scriptsId()).adjusted(QUrl::RemoveFilename),
+		                                  i18n("R history files [*.Rhistory](*.Rhistory);;All files [*](*)"));
+		if (url.isEmpty()) return;
 	}
 
 	QTemporaryFile *tmpfile = nullptr;
 	QString filename;
-	if (!url.isLocalFile ()) {
-		tmpfile = new QTemporaryFile (this);
-		KIO::Job* getjob = KIO::file_copy (url, QUrl::fromLocalFile (tmpfile->fileName()));
-		KJobWidgets::setWindow (getjob, RKWardMainWindow::getMain ());
-		if (!getjob->exec ()) {
-			getjob->uiDelegate ()->showErrorMessage();
+	if (!url.isLocalFile()) {
+		tmpfile = new QTemporaryFile(this);
+		KIO::Job *getjob = KIO::file_copy(url, QUrl::fromLocalFile(tmpfile->fileName()));
+		KJobWidgets::setWindow(getjob, RKWardMainWindow::getMain());
+		if (!getjob->exec()) {
+			getjob->uiDelegate()->showErrorMessage();
 			delete (tmpfile);
 			return;
 		}
-		filename = tmpfile->fileName ();
+		filename = tmpfile->fileName();
 	} else {
-		filename = url.toLocalFile ();
+		filename = url.toLocalFile();
 	}
 
-	QFile file (filename);
-	if (!file.open (QIODevice::Text | QIODevice::ReadOnly)) return;
-	setCommandHistory (QString (file.readAll ()).split ('\n', Qt::SkipEmptyParts), false);
-	file.close ();
+	QFile file(filename);
+	if (!file.open(QIODevice::Text | QIODevice::ReadOnly)) return;
+	setCommandHistory(QString::fromUtf8(file.readAll()).split(u'\n', Qt::SkipEmptyParts), false);
+	file.close();
 
-	delete (tmpfile);
+	delete tmpfile;
 }
 
-void RKConsole::userSaveHistory (const QUrl &_url) {
-	RK_TRACE (APP);
+void RKConsole::userSaveHistory(const QUrl& _url) {
+	RK_TRACE(APP);
 
 	QUrl url = _url;
-	if (url.isEmpty ()) {
-		url = QFileDialog::getSaveFileUrl (this, i18n ("Select filename to save command history"), QUrl (), i18n ("R history files [*.Rhistory] (*.Rhistory);;All files [*] (*)"));
-		if (url.isEmpty ()) return;
+	if (url.isEmpty()) {
+		url = QFileDialog::getSaveFileUrl(this, i18n("Select filename to save command history"), QUrl(),
+		                                  i18n("R history files [*.Rhistory] (*.Rhistory);;All files [*] (*)"));
+		if (url.isEmpty()) return;
 	}
 
 	QTemporaryFile tempfile;
-	tempfile.open ();
-	tempfile.write (QString (commandHistory ().join (QStringLiteral("\n")) + '\n').toLocal8Bit ().data ());
-	tempfile.close ();
-
-	KIO::Job* getjob = KIO::file_copy (QUrl::fromLocalFile (tempfile.fileName()), url);
-	KJobWidgets::setWindow (getjob, RKWardMainWindow::getMain ());
-	if (!getjob->exec ()) {
-		getjob->uiDelegate ()->showErrorMessage();
+	tempfile.open();
+	tempfile.write(QString(commandHistory().join(QStringLiteral("\n")) + u'\n').toLocal8Bit().data());
+	tempfile.close();
+
+	KIO::Job* getjob = KIO::file_copy(QUrl::fromLocalFile(tempfile.fileName()), url);
+	KJobWidgets::setWindow(getjob, RKWardMainWindow::getMain());
+	if (!getjob->exec()) {
+		getjob->uiDelegate()->showErrorMessage();
 		return;
 	}
 }
 
-QString RKConsole::cleanSelection (const QString &origin) {
-	RK_TRACE (APP);
+QString RKConsole::cleanSelection(const QString& origin) {
+	RK_TRACE(APP);
 
 	QString ret;
-	ret.reserve (origin.length ());
-	const QStringList lines = origin.split ('\n');
+	ret.reserve(origin.length());
+	const QStringList lines = origin.split(u'\n');
 	for (const QString& line : lines) {
 		if (line.startsWith(nprefix)) {
 			ret.append(QStringView{line}.mid(nprefix.length()));
@@ -741,30 +745,30 @@ QString RKConsole::cleanSelection (const QString &origin) {
 		} else {
 			ret.append(line);
 		}
-		ret.append ('\n');
+		ret.append(u'\n');
 	}
 
 	return ret;
 }
 
-void RKConsole::copyCommands () {
-	RK_TRACE (APP);
+void RKConsole::copyCommands() {
+	RK_TRACE(APP);
 
-	KTextEditor::Range sel = view->selectionRange ();
-	if (!sel.isValid ()) return;
+	KTextEditor::Range sel = view->selectionRange();
+	if (!sel.isValid()) return;
 
 	// we use this somewhat cumbersome (and inefficient) approach as it should also be correct in case of blockwise selections
-	QStringList command_lines = view->selectionText ().split ('\n');
+	QStringList command_lines = view->selectionText().split(u'\n');
 	int i = 0;
-	for (int l = sel.start ().line (); l <= sel.end ().line (); ++l) {
-		QString line = doc->line (l);
-		if (!(line.startsWith (iprefix) || line.startsWith (nprefix))) {
-			command_lines.removeAt (i);
+	for (int l = sel.start().line(); l <= sel.end().line(); ++l) {
+		QString line = doc->line(l);
+		if (!(line.startsWith(iprefix) || line.startsWith(nprefix))) {
+			command_lines.removeAt(i);
 			--i;
 		}
 		++i;
 	}
-	QApplication::clipboard()->setText (cleanSelection (command_lines.join (QStringLiteral("\n"))));
+	QApplication::clipboard()->setText(cleanSelection(command_lines.join(QStringLiteral("\n"))));
 }
 
 void RKConsole::literalCopy () {
@@ -887,15 +891,15 @@ void RKConsole::pipeCommandThroughConsoleLocal (const QString &command_string) {
 		}
 	}
 	if (RKSettingsModuleConsole::addPipedCommandsToHistory() != RKSettingsModuleConsole::DontAdd) {
-		QStringList lines = command_string.split ('\n', Qt::SkipEmptyParts);
+		QStringList lines = command_string.split (u'\n', Qt::SkipEmptyParts);
 		if ((RKSettingsModuleConsole::addPipedCommandsToHistory() == RKSettingsModuleConsole::AlwaysAdd) || (lines.count () == 1)) {
 			for (int i = 0; i < lines.count (); ++i) {
 				commands_history.append (lines[i]);
 			}
 		}
 	}
-	cursorAtTheEnd ();
-	submitBatch (command_string + '\n');
+	cursorAtTheEnd();
+	submitBatch(command_string + u'\n');
 	previous_chunk_was_piped = true;
 }
 
@@ -932,13 +936,13 @@ void RKConsole::activate (bool with_focus) {
 
 
 RKConsolePart::RKConsolePart(RKConsole *console) : KParts::Part(nullptr) {
-	RK_TRACE (APP);
+	RK_TRACE(APP);
 
-	setComponentName (QCoreApplication::applicationName (), QGuiApplication::applicationDisplayName ());
+	setComponentName(QCoreApplication::applicationName(), QGuiApplication::applicationDisplayName());
 
-	setWidget (console);
+	setWidget(console);
 
-	setXMLFile (QStringLiteral("rkconsolepart.rc"));
+	setXMLFile(QStringLiteral("rkconsolepart.rc"));
 }
 
 RKConsolePart::~RKConsolePart () {
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 3c3277c65..ef721a810 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -272,7 +272,7 @@ void RKWardMainWindow::doPostInit () {
 		}
 
 		if (RKSettingsModuleGeneral::workplaceSaveMode () == RKSettingsModuleGeneral::SaveWorkplaceWithSession) {
-			RKWorkplace::mainWorkplace ()->restoreWorkplace (RKSettingsModuleGeneral::getSavedWorkplace (KSharedConfig::openConfig ().data ()).split ('\n'));
+			RKWorkplace::mainWorkplace()->restoreWorkplace(RKSettingsModuleGeneral::getSavedWorkplace(KSharedConfig::openConfig().data ()).split(u'\n'));
 		}
 		if (RKSettingsModuleGeneral::showHelpOnStartup() && !testmode_suppress_dialogs) toplevel_actions->showRKWardHelp ();
 	}
@@ -355,42 +355,42 @@ void RKWardMainWindow::initPlugins (const QStringList &automatically_added) {
 		KMessageBox::informationList (RKWardMainWindow::getMain (), i18n ("New RKWard plugin packs (listed below) have been found, and have been activated, automatically. To de-activate selected plugin packs, use Settings->Configure RKWard->Plugins."), automatically_added, i18n ("New plugins found"), QStringLiteral("new_plugins_found"));
 	}
 	if (!completely_broken_maps.isEmpty ()) {
-		QString maplist = "<ul><li>" + completely_broken_maps.join (QStringLiteral("</li>\n<li>")) + "</li></ul>";
+		QString maplist = u"<ul><li>"_s + completely_broken_maps.join(u"</li>\n<li>"_s) + u"</li></ul>"_s;
 		KMessageBox::detailedError(nullptr, QStringLiteral("<p>%1</p><p>%2</p>").arg(i18n("The following RKWard pluginmap files could not be loaded, and have been disabled. This could be because they are broken, not compatible with this version of RKWard, or not meant for direct loading (see the 'Details' for more information). They have been disabled."), maplist), completely_broken_maps_details.join (QStringLiteral("\n")), i18n("Failed to load some plugin maps"));
 	}
 	if (!somewhat_broken_maps.isEmpty ()) {
-		QString maplist = "<ul><li>" + somewhat_broken_maps.join (QStringLiteral("</li>\n<li>")) + "</li></ul>";
+		QString maplist = u"<ul><li>"_s + somewhat_broken_maps.join(u"</li>\n<li>"_s) + u"</li></ul>"_s;
[suppressed due to size limit]
 	}
 
 	slotSetStatusReady ();
 }
 
-void RKWardMainWindow::startR () {
-	RK_TRACE (APP);
+void RKWardMainWindow::startR() {
+	RK_TRACE(APP);
 
 	setRStatus(RInterface::Starting);
 	// make sure our general purpose files directory exists
-	QString packages_path = RKSettingsModuleGeneral::filesPath() + "/.rkward_packages";
-	bool ok = QDir ().mkpath (packages_path);
-	RK_ASSERT (ok);
+	QString packages_path = RKSettingsModuleGeneral::filesPath() + u"/.rkward_packages"_s;
+	bool ok = QDir().mkpath(packages_path);
+	RK_ASSERT(ok);
 
 	// Copy RKWard R source packages to general  purpose files directory (if still needed).
 	// This may look redundant at first (since the package still needs to be installed from the
 	// backend. However, if frontend and backend are on different machines (eventually), only  the
 	// filesPath is shared between both.
-	QStringList packages({"rkward.tgz", "rkwardtests.tgz"});
-	for (int i = 0; i < packages.size (); ++i) {
-		QString package = QDir (packages_path).absoluteFilePath (packages[i]);
+	QStringList packages({u"rkward.tgz"_s, u"rkwardtests.tgz"_s});
+	for (int i = 0; i < packages.size(); ++i) {
+		QString package = QDir(packages_path).absoluteFilePath(packages[i]);
 		if (RKSettingsModuleGeneral::rkwardVersionChanged() || RKCommandLineArgs::get(RKCommandLineArgs::Setup).toBool()) {
 			RK_DEBUG(APP, DL_INFO, "RKWard version changed or setup requested. Discarding cached package at %s", qPrintable(package));
-			if(QFileInfo::exists(package)) {
+			if (QFileInfo::exists(package)) {
 				bool rem = QFile::remove(package);
 				RK_ASSERT(rem);
 			}
 		}
 		if (!QFileInfo::exists(package)) {
-			QString source = RKCommonFunctions::getRKWardDataDir() + "/rpackages/" + packages[i];
+			QString source = RKCommonFunctions::getRKWardDataDir() + u"/rpackages/"_s + packages[i];
 			RK_ASSERT(QFileInfo::exists(source));
 			RK_DEBUG(APP, DL_INFO, "Copying rkward R source package %s to %s", qPrintable(source), qPrintable(package));
 			RK_ASSERT(QFile::copy(source, package));
@@ -403,7 +403,7 @@ void RKWardMainWindow::startR () {
 	connect(RInterface::instance(), &RInterface::backendWorkdirChanged, this, &RKWardMainWindow::updateCWD);
 	RObjectList::init();
 
-	RObjectBrowser::mainBrowser ()->unlock ();
+	RObjectBrowser::mainBrowser()->unlock();
 }
 
 void RKWardMainWindow::slotConfigure() {
@@ -1006,41 +1006,44 @@ void RKWardMainWindow::slotNewCommandEditor () {
 	RKWorkplace::mainWorkplace()->openScriptEditor();
 }
 
-void RKWardMainWindow::openAnyFile () {
-	RK_TRACE (APP);
+void RKWardMainWindow::openAnyFile() {
+	RK_TRACE(APP);
 
-	QFileDialog* dialog = new QFileDialog(nullptr, QString(), RKRecentUrls::mostRecentUrl(RKRecentUrls::scriptsId()).adjusted(QUrl::RemoveFilename).toLocalFile(), QStringLiteral ("*|All Files (*)\n%1|R Script Files (%1)").arg(RKSettingsModuleCommandEditor::scriptFileFilter()));
+	QFileDialog* dialog =
+	    new QFileDialog(nullptr, QString(), RKRecentUrls::mostRecentUrl(RKRecentUrls::scriptsId()).adjusted(QUrl::RemoveFilename).toLocalFile(),
+	                    QStringLiteral("*|All Files (*)\n%1|R Script Files (%1)").arg(RKSettingsModuleCommandEditor::scriptFileFilter()));
 	dialog->setFileMode(QFileDialog::ExistingFiles);
 
-// Create a type selection widget, and hack it into the dialog:
-	QFrame* dummy = new QFrame (this);
-	dummy->setWindowTitle (i18n ("Open"));
-	QVBoxLayout* layout = new QVBoxLayout (dummy);
+	// Create a type selection widget, and hack it into the dialog:
+	QFrame* dummy = new QFrame(this);
+	dummy->setWindowTitle(i18n("Open"));
+	QVBoxLayout* layout = new QVBoxLayout(dummy);
 	QHBoxLayout* hbox = new QHBoxLayout;
-	layout->addLayout (hbox);
-	hbox->addWidget (new QLabel (i18n ("Opening mode:")));
+	layout->addLayout(hbox);
+	hbox->addWidget(new QLabel(i18n("Opening mode:")));
 	QComboBox* open_mode = new QComboBox;
-	open_mode->addItems (QStringList () << i18n ("Guess file type, automatically") << i18n ("Open as text / script file") << i18n ("Open as text file and force R highlighting") << ("Open as R workspace"));
-	hbox->addWidget (open_mode);
-	hbox->setStretchFactor (open_mode, 100);
-
-	dummy->setWindowFlags (dialog->windowFlags ());
-	dialog->setOption (QFileDialog::DontUseNativeDialog);
-	dialog->setWindowFlags (Qt::Widget);
-	layout->addWidget (dialog);
-	dummy->show ();
-	auto res = dialog->exec ();
-	QUrl url = QUrl::fromLocalFile (dialog->selectedFiles ().value (0));
-	int mode = open_mode->currentIndex ();
+	open_mode->addItems(QStringList() << i18n("Guess file type, automatically") << i18n("Open as text / script file")
+	                                  << i18n("Open as text file and force R highlighting") << i18n("Open as R workspace"));
+	hbox->addWidget(open_mode);
+	hbox->setStretchFactor(open_mode, 100);
+
+	dummy->setWindowFlags(dialog->windowFlags());
+	dialog->setOption(QFileDialog::DontUseNativeDialog);
+	dialog->setWindowFlags(Qt::Widget);
+	layout->addWidget(dialog);
+	dummy->show();
+	auto res = dialog->exec();
+	QUrl url = QUrl::fromLocalFile(dialog->selectedFiles().value(0));
+	int mode = open_mode->currentIndex();
 	delete dummy;
 	if (res != QDialog::Accepted) return;
 
 	if (mode == 0) {
-		RKWorkplace::mainWorkplace ()->openAnyUrl (url);
+		RKWorkplace::mainWorkplace()->openAnyUrl(url);
 	} else if (mode == 1) {
-		RKWorkplace::mainWorkplace ()->openScriptEditor (url);
+		RKWorkplace::mainWorkplace()->openScriptEditor(url);
 	} else if (mode == 2) {
-		RKWorkplace::mainWorkplace ()->openScriptEditor (url, QString (), RKCommandEditorFlags::DefaultFlags | RKCommandEditorFlags::ForceRHighlighting);
+		RKWorkplace::mainWorkplace()->openScriptEditor(url, QString(), RKCommandEditorFlags::DefaultFlags | RKCommandEditorFlags::ForceRHighlighting);
 	} else if (mode == 3) {
 		askOpenWorkspace(url);
 	}
@@ -1075,15 +1078,15 @@ void RKWardMainWindow::slotOpenCommandEditor (const QUrl &url, const QString &en
 	}
 }
 
-void RKWardMainWindow::setCaption (const QString &) {
-	RK_TRACE (APP);
+void RKWardMainWindow::setCaption(const QString &) {
+	RK_TRACE(APP);
 
-	QString wcaption = RKWorkplace::mainWorkplace ()->workspaceURL ().fileName ();
-	if (wcaption.isEmpty ()) wcaption = RKWorkplace::mainWorkplace ()->workspaceURL ().toDisplayString ();
-	if (wcaption.isEmpty ()) wcaption = i18n ("[Unnamed Workspace]");
-	RKMDIWindow *window = RKWorkplace::mainWorkplace ()->view ()->activePage ();
-	if (window) wcaption.append (" - " + window->fullCaption ());
-	KParts::MainWindow::setCaption (wcaption);
+	QString wcaption = RKWorkplace::mainWorkplace()->workspaceURL().fileName();
+	if (wcaption.isEmpty()) wcaption = RKWorkplace::mainWorkplace()->workspaceURL().toDisplayString();
+	if (wcaption.isEmpty()) wcaption = i18n("[Unnamed Workspace]");
+	RKMDIWindow *window = RKWorkplace::mainWorkplace()->view()->activePage();
+	if (window) wcaption.append(u" - "_s + window->fullCaption());
+	KParts::MainWindow::setCaption(wcaption);
 }
 
 
diff --git a/rkward/robjectviewer.cpp b/rkward/robjectviewer.cpp
index 953cd09d3..502bc37a9 100644
--- a/rkward/robjectviewer.cpp
+++ b/rkward/robjectviewer.cpp
@@ -114,19 +114,20 @@ void RObjectViewer::objectDataChanged (RObject* object, const RObject::ChangeSet
 	}
 }
 
-void RObjectViewer::initDescription (bool notify) {
-	RK_TRACE (APP);
+void RObjectViewer::initDescription(bool notify) {
+	RK_TRACE(APP);
 
 	if (!_object) return;
 
-	setCaption (i18n("Object Viewer: %1", _object->getShortName ()));
+	setCaption(i18n("Object Viewer: %1", _object->getShortName()));
 	// make the description use less height. Trying to specify <nobr>s, here, is no good idea (see http://sourceforge.net/p/rkward/bugs/55/)
-	description_label->setText("<i>" + _object->getShortName().replace('<', QLatin1String("<")) + "</i>   " + _object->getObjectDescription ().replace (QLatin1String("<br>"), QLatin1String("    ")));
+	description_label->setText(u"<i>"_s + _object->getShortName().replace(u'<', u"<"_s) + u"</i>   "_s +
+	                           _object->getObjectDescription().replace(u"<br>"_s, u"    "_s));
 	if (notify) {
-		QString reason = i18n ("The object was changed. You may want to click \"Update\"");
-		summary_widget->invalidate (reason);
-		print_widget->invalidate (reason);
-		structure_widget->invalidate (reason);
+		QString reason = i18n("The object was changed. You may want to click \"Update\"");
+		summary_widget->invalidate(reason);
+		print_widget->invalidate(reason);
+		structure_widget->invalidate(reason);
 	}
 }
 
@@ -231,7 +232,7 @@ void RObjectViewerWidget::setText (const QString& text) {
 
 RCommand* RObjectSummaryWidget::makeCommand() {
 	RK_TRACE(APP);
-	return new RCommand("print(summary(" + _object->getFullName() + "))", RCommand::App);
+	return new RCommand(u"print(summary("_s + _object->getFullName() + u"))"_s, RCommand::App);
 }
 
 ////////////////// print widget /////////////////
@@ -240,18 +241,18 @@ RCommand* RObjectPrintWidget::makeCommand() {
 	RK_TRACE(APP);
 
 	// make sure to print as wide as possible
-	return new RCommand("local({\n"
+	return new RCommand(QStringLiteral("local({\n"
 	                                  "\trk.temp.width.save <- getOption(\"width\")\n"
 	                                  "\toptions(width=10000)\n"
 	                                  "\ton.exit(options(width=rk.temp.width.save))\n"
-	                                  "\tprint(" + _object->getFullName() + ")\n"
-	                                  "})", RCommand::App);
+	                                  "\tprint(") + _object->getFullName() + QStringLiteral(")\n"
+	                                  "})"), RCommand::App);
 }
 
 ////////////////// structure widget /////////////////
 
 RCommand* RObjectStructureWidget::makeCommand() {
 	RK_TRACE(APP);
-	return new RCommand("str(" + _object->getFullName() + ')', RCommand::App);
+	return new RCommand(u"str("_s + _object->getFullName() + u')', RCommand::App);
 }
 
diff --git a/rkward/scriptbackends/CMakeLists.txt b/rkward/scriptbackends/CMakeLists.txt
index 9bfabb699..16edc7002 100644
--- a/rkward/scriptbackends/CMakeLists.txt
+++ b/rkward/scriptbackends/CMakeLists.txt
@@ -16,4 +16,3 @@ ADD_LIBRARY(scriptbackends STATIC ${scriptbackends_STAT_SRCS})
 TARGET_LINK_LIBRARIES(scriptbackends Qt6::Qml Qt6::Widgets Qt6::Xml KF6::WidgetsAddons KF6::I18n)
 
 INSTALL(FILES common.js rkcomponentscripting.js DESTINATION ${KDE_INSTALL_DATADIR}/rkward/phpfiles )
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/settings/CMakeLists.txt b/rkward/settings/CMakeLists.txt
index 3acb41193..07e061130 100644
--- a/rkward/settings/CMakeLists.txt
+++ b/rkward/settings/CMakeLists.txt
@@ -35,4 +35,3 @@ ENDIF (WIN32 OR USE_BINARY_PACKAGES)
 
 ADD_LIBRARY(settings STATIC ${settings_STAT_SRCS})
 TARGET_LINK_LIBRARIES(settings Qt6::Widgets KF6::WidgetsAddons Qt6::Xml KF6::ConfigCore KF6::Parts KF6::TextEditor KF6::I18n KF6::KIOWidgets)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/windows/CMakeLists.txt b/rkward/windows/CMakeLists.txt
index 7dc0d48c8..3626b3a1e 100644
--- a/rkward/windows/CMakeLists.txt
+++ b/rkward/windows/CMakeLists.txt
@@ -33,4 +33,3 @@ SET(windows_STAT_SRCS
 
 ADD_LIBRARY(windows STATIC ${windows_STAT_SRCS})
 TARGET_LINK_LIBRARIES(windows Qt6::Widgets Qt6::PrintSupport Qt6::WebEngineWidgets KF6::TextEditor KF6::Notifications KF6::WindowSystem KF6::KIOFileWidgets KF6::I18n)
-add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level


More information about the rkward-tracker mailing list