[QScintilla] Another QScintilla Unicode issue

Phil Thompson phil at riverbankcomputing.com
Sat Aug 14 16:30:20 BST 2010


On Sun, 1 Aug 2010 11:24:49 +0200, detlev <detlev at die-offenbachs.de>
wrote:
> On Sonntag, 1. August 2010, Baz Walter wrote:
>> On 31/07/10 17:25, detlev wrote:
>> > Hi,
>> > 
>> > if I show an autocompletion list or userlist with
>> > QsciScintilla.showUserList(...) for a list that contains a string
with
>> > a
>> > non- ASCII character (e.g. 'Ü'), that character is not shown
correctly
>> > and is not returned correctly when selected (e.g. handleÜmlauts is
>> > shown
>> > as handle�mlauts).
>> 
>> i tried something like this:
>> 
>> mylist = u'\xDC \xDD \xDE \xDF'
>> 
>> if self.isUtf8():
>>      mylist = mylist.encode('utf-8')
>> else:
>>      mylist = mylist.encode('latin-1')
>> 
>> self.SendScintilla(self.SCI_USERLISTSHOW, 1, mylist)
>> 
>> ...and the non-ascii characters were displayed correctly.
>> 
>> so it looks like qscintilla's listbox is unicode-aware, but the
>> showuserlist method is not.
> 
> I found this line of code in qsciscintilla.cpp:
> 
>     SendScintilla(SCI_USERLISTSHOW, id,
>             list.join(QChar(userSeparator)).toLatin1().data());
> 
> Phil, it seems you should include a check like the one shown by Baz
Walter
> and 
> use ...toUtf8().data() if isUtf8() returns true.

Fixed in tonight's snapshot - along with a similar change for
auto-completion lists.

Phil


More information about the QScintilla mailing list