Skip to content

fix: count message length in unicode codepoints - #7256

Merged
pajlada merged 2 commits into
Chatterino:masterfrom
3r01:fix-codepoint-message-length
Sep 12, 2026
Merged

pajlada merged 2 commits into
Chatterino:masterfrom
3r01:fix-codepoint-message-length

Conversation

@3r01

@3r01 3r01 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Some emojis count twice towards the input length because QString::length() is used, which counts UTF-16 code units rather than unicode codepoints.

image

The indicator turns red and reads 500 when the input contains 250 of these, but twitch allows you to send 500.

Fixed by counting unicode codepoints instead.

@pajlada pajlada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in my testing.
Funnily enough, a wall of lions count as ascii art

@pajlada
pajlada enabled auto-merge (squash) September 12, 2026 10:16
@pajlada
pajlada merged commit 1af212c into Chatterino:master Sep 12, 2026
18 checks passed
@3r01
3r01 deleted the fix-codepoint-message-length branch September 12, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants