[go: up one dir, main page]

Menu

#2471 SCI_GETENDSTYLED returns position that points to the middle of a code point

Bug
open
nobody
scintilla (608)
5
2025-04-02
2025-03-28
Ahmet Sait
No
  1. Text: 𠀀x
  2. Style all text with SCI_STARTSTYLING.
  3. Delete x from text.
  4. Call to SCI_GETENDSTYLED at this point returns 3 instead of 0.

𠀀 is encoded as 0xF0 0xA0 0x80 0x80 and the index points to 0x80, should point to start of the whole code point instead.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2025-04-02

    This doesn't appear to cause further problems. Why do you want it changed?

     
  • Ahmet Sait

    Ahmet Sait - 2025-04-02

    It does cause problems in Scintilla.NET where I have to maintain utf-8 <-> utf-16 index mappings and suddenly Scintilla gives me a nonsense position which makes GetEndStyled() calculate a position pointing to a low surrogate pair instead of an actual character.

     

Log in to post a comment.