From ea4b637758ea3c50b06c9b6e34607eed1c8afd1c Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Thu, 27 Jan 2022 16:27:54 +0200 Subject: KCM: Make sure Unicode is used for editing bashrc This resolves issue #6. Signed-off-by: Mavridis Philippe (cherry picked from commit a7d117f83a8077173ad95e28e3ba05ccf75eab70) --- kcm_gtk/kcmgtk.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kcm_gtk/kcmgtk.cpp') diff --git a/kcm_gtk/kcmgtk.cpp b/kcm_gtk/kcmgtk.cpp index 0667731..bd3ab79 100644 --- a/kcm_gtk/kcmgtk.cpp +++ b/kcm_gtk/kcmgtk.cpp @@ -509,13 +509,14 @@ void KcmGtk::save() if (file.exists()) { file.open(IO_ReadOnly); - TQByteArray fileData = file.readAll(); + TQTextStream fileDataStream = TQTextStream(&file); + fileDataStream.setEncoding(TQTextStream::Locale); + TQString fileDataString = fileDataStream.read(); file.close(); TQString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0"; - TQString fileDataString(fileData); fileDataString.replace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine); - + file.open(IO_WriteOnly); stream.setDevice(TQT_TQIODEVICE(&file)); stream << fileDataString; -- cgit v1.2.1