[QScintilla] Using python strings with SendScintilla

Baz Walter bazwal at ftml.net
Sun Nov 9 15:19:26 GMT 2008


Phil Thompson wrote:
> There's no problem with adding something like...
> 
> const char *QsciScintilla::rawText() const;
> void QsciScintilla::setRawText(const char *text);

please ignore my other reply to this post. i have just realised that 
python 2.6 now has bytearray objects. so my original method becomes:

     def range(self, start, end, decode=True):
         bytes = bytearray(end - start)
         self.SendScintilla(QSB.SCI_GETTEXTRANGE, start, end, bytes)
         if decode:
             return bytes.decode('utf8')
         return bytes # or str(bytes)

given that, it looks like the proposed rawText methods won't be needed 
as you've already solved my initial problem by providing support for 
python 2.6!

Regards
Baz Walter


More information about the QScintilla mailing list