[QScintilla] Strings with \0 charaters in it?

Phil Thompson phil at riverbankcomputing.com
Tue Apr 25 17:45:32 BST 2017


On 25 Apr 2017, at 5:08 pm, Matic Kukovec <kukovecmatic at hotmail.com> wrote:
> 
> Hi guys,
> 
> I just noticed that when adding strings that contain null characters ('\0') using the setText method,
> QScintilla cuts off the string at the first null character it finds. To be sure I opened the same text saved
> to a file with Notepad++ and SciTE and there the null characters appear.
> 
> Is this a bug or should strings with null characters be handled differently?
> I used this example to for testing:
> qscieditor.setText("Test\nText\nIn\n\0An\nQscintilla\nEditor")

Is that C++ or Python?

setText() uses the low-level Scintilla SCI_SETTEXT which accepts a '\0' string, ie. you will get the same result if you used Scintilla.

Phil


More information about the QScintilla mailing list