From 3a0e29cf284294ea818396078e5e1a38e7b4657e Mon Sep 17 00:00:00 2001 From: mgr Date: Wed, 1 Nov 2017 20:19:00 +0100 Subject: [PATCH] Fixed incorrect display of SQL calltips containing non-US-ASCII characters. QScintilla was incorrectly converting the text of the calltips to Latin1 although the encoding was set to UTF-8. This fixes #1107 (Russian) and #1206 (Korean). --- libs/qscintilla/Qt4Qt5/qsciscintilla.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp b/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp index d40b742d..4c9fe752 100644 --- a/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp +++ b/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp @@ -386,7 +386,12 @@ void QsciScintilla::callTip() ct = ct_entries.join("\n"); } - QByteArray ct_ba = ct.toLatin1(); + QByteArray ct_ba; + if (isUtf8()) + ct_ba = ct.toUtf8(); + else + ct_ba = ct.toLatin1(); + const char *cts = ct_ba.data(); SendScintilla(SCI_CALLTIPSHOW, adjustedCallTipPosition(shift), cts);