[QScintilla] Another QScintilla Unicode issue

detlev detlev at die-offenbachs.de
Sun Aug 1 10:24:49 BST 2010


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.

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the QScintilla mailing list