Repository navigation
Widen narrow emoji modifier sequences to two columns - #162
Merged
christianparpart merged 1 commit intoNov 20, 2026
Merged
christianparpart merged 1 commit into
christianparpart merged 1 commit into
Conversation
Signed-off-by: trackd <17672644+trackd@users.noreply.github.com>
christianparpart
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
grapheme_cluster_width()returns one column for ✌🏽 (U+270C U+1F3FD). The skin-tone modifier joins the grapheme cluster, but the width accumulator keeps the one-column width of bare ✌. Unicode defines the pair as a fully qualified emoji modifier sequence with emoji presentation. Unicode 17 emoji test data · UTS #51 §2.7.1Update the shared width accumulator so a skin-tone modifier widens a one-column
Emoji_Modifier_Baseto two columns. The modifier still occupies no separate cell. The shared rule applies to bothgrapheme_cluster_width()and incrementalscan_text().Evidence
270C270C FE0F270C 1F3FD1F44B 1F3FD00A9 1F3FDThe baseline matched Contour’s cursor measurements for all 3,944 fully qualified Emoji 17 entries. The prototype corrected the 45 one-column results. All 3,944 then measured two columns through both width APIs, including when scanner input was split after the first code point. All 371 standardized VS16 pairs still measured two columns.
The width and split-scanner regressions fail on the baseline and pass with the patch. The full libunicode suite passed on Windows Release, including the Unicode 17 grapheme and word break conformance tests, with one pre-existing expected failure for a double-ZWJ case. The end-to-end check in a rebuilt Contour remains pending.
Compatibility
This changes parity with Python
wcwidth0.8.2 for affected modifier sequences. Applications that continue to measure those sequences as one column may disagree with terminals using the updated rule. Unicode specifies emoji presentation and leaves terminal column allocation to the implementation. The proposed width follows Contour’s two-column emoji convention. libunicode’s compatibility rationale · Terminal Unicode Core