QScintilla: patch for correct display of SQL calltips containing non-US-ASCII characters

Manuel Gómez mgrojo at gmail.com
Fri Oct 9 21:14:26 BST 2020


> El 1 nov. 2017 22:05, "Phil Thompson" <phil at riverbankcomputing.com 
> <mailto:phil at riverbankcomputing.com>> escribió:
> 
>     On 1 Nov 2017, at 7:50 pm, Manuel Gómez <mgrojo at gmail.com
>     <mailto:mgrojo at gmail.com>> wrote:
>      >
>      > Hi.
>      >
>      > Thanks for developing QScintilla. I don't know whether this
>     address is the appropiate for this. In any case, I attach a patch
>     that solves the following issue:
>      >
>      > 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.
> 
>     Thanks. (The QScintilla mailing list is the best place to send stuff.)
> 

There is a further subcase of this bug. When the user access the call 
tip text using the arrows, the text is displayed with incorrect 
diacritics. This patch fixes it:

diff --git a/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp 
b/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp
index 08548696..d261ba40 100644
--- a/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp
+++ b/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp
@@ -470,7 +470,10 @@ void QsciScintilla::handleCallTipClick(int dir)
      if (ct_cursor > 0)
          ct.prepend('\001');

-    SendScintilla(SCI_CALLTIPSHOW, adjustedCallTipPosition(shift), 
ct.toLatin1().data());
+    ScintillaBytes ct_bytes = textAsBytes(ct);
+    const char *cts = ScintillaBytesConstData(ct_bytes);
+
+    SendScintilla(SCI_CALLTIPSHOW, adjustedCallTipPosition(shift), cts);
  }





More information about the QScintilla mailing list