summaryrefslogtreecommitdiffstats
path: root/tdeui
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-11-27 03:32:12 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-11-27 03:32:32 +0100
commitb4034166a5f445c3eafd2a7db235ba0a76c4de69 (patch)
tree8f15eec1a527d49cfb7d16031ddbd09cc65fafd5 /tdeui
parent38e386a7e27a19e81b484e2eabde3d24cfd6c4cf (diff)
downloadtdelibs-b4034166a5f445c3eafd2a7db235ba0a76c4de69.tar.gz
tdelibs-b4034166a5f445c3eafd2a7db235ba0a76c4de69.zip
KPasswordEdit: Add a password conversion to local8Bit()
using setCodecForCStrings. This resolves bug 2961. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdeui')
-rw-r--r--tdeui/kpassdlg.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tdeui/kpassdlg.cpp b/tdeui/kpassdlg.cpp
index 87df72f60..8e0e12f18 100644
--- a/tdeui/kpassdlg.cpp
+++ b/tdeui/kpassdlg.cpp
@@ -33,6 +33,7 @@
#include <tqwhatsthis.h>
#include <tqptrdict.h>
#include <tqtimer.h>
+#include <tqtextcodec.h>
#include <tdeglobal.h>
#include <kdebug.h>
@@ -139,7 +140,11 @@ KPasswordEdit::~KPasswordEdit()
}
const char *KPasswordEdit::password() const {
- return text().ascii();
+ TQTextCodec *origCStringCodec = TQTextCodec::codecForCStrings();
+ TQTextCodec::setCodecForCStrings(TQTextCodec::codecForLocale());
+ const char *outputPassword = text().ascii();
+ TQTextCodec::setCodecForCStrings(origCStringCodec);
+ return outputPassword;
}
void KPasswordEdit::erase()