Bug 382465

Summary: Code highlighting shifted after UTF-8 character
Product: [Applications] kdevelop Reporter: tuxtoriel
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal CC: igorkuo, kde, kossebau, mail, plasteredparrot, silverunicorn2011
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Examples screenshot

Description tuxtoriel 2017-07-18 13:48:29 UTC
Created attachment 106707 [details]
Examples screenshot

When, in the code, a character like '…', '«', '»', 'ç', 'ß' is used, the code highlighting after it is shifted.

Example:

OK:
    `std::cout << "Does this work?" << std::endl;`
BUG:
    `std::cout << "Does this work?…" << std::endl;` here the shift is of 2 characters
BUG:
    `std::cout << "Does this work?ç" << std::endl;` here the shift is of 1 character
Comment 1 Dan Weatherill 2018-01-16 19:56:44 UTC
I'm pretty sure this is the same issue that this person runs into: 
https://stackoverflow.com/questions/47192819/libclang-get-correct-reference-of-identifier-with-extended-characters-for-vari
Comment 2 Vitaliy 2018-03-07 19:48:48 UTC
(In reply to Dan Weatherill from comment #1)
> I'm pretty sure this is the same issue that this person runs into: 
> https://stackoverflow.com/questions/47192819/libclang-get-correct-reference-
> of-identifier-with-extended-characters-for-vari

That only means libclang reports byte indices instead of character indices. But KDevelop has the lines so has all the information necessary to convert them back and forth.
Comment 3 Igor Kushnir 2022-01-13 14:58:03 UTC

*** This bug has been marked as a duplicate of bug 274430 ***