Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of surrogate pairs in ircview and inputeditor #2569

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

ctrlaltca
Copy link
Contributor

@ctrlaltca ctrlaltca commented Nov 23, 2023

The ircview and input editor (used also in topic editor) contains custom methods to render text on screen.
They didn't take in account that QString can contain surrogate pairs: 2 characters that gets drawn as a single character.
Example of these characters are emojis like 😀😃😄
As a consequence, selecting or editing text containing these characters would lead to the wrong calculation of each character width, causing overlapped and jumping text when selected, or the appearance of Mojibake.
This PR fixes handling of these weirdos.

Possible fix for #2566
Fix #2051

As a bonus, fix out of bound memory read when a line ends with a tab
Fix #2377

@ctrlaltca ctrlaltca merged commit 90d1f02 into kvirc:master Nov 28, 2023
2 checks passed
@ctrlaltca ctrlaltca deleted the fix_surrogate branch November 28, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant