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 clustering of gc=Cf, GCB=CN codepoints #18285

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Dec 4, 2024

  • Previously we would mark all gc=Cf (Control, format) codepoints
    as zero-width, but that ignores that the majority of them are also
    GCB=CN (Control = does not join), which meant we ended up with
    zero-width grapheme clusters. Those cannot exist under a terminal.
    So, this PR makes all gc=Cf, GCB=CN codepoints zero-width, but also
    treats them as Extender codepoints, which mirrors wcswidth.
  • This PR also updates the tables to Unicode 16.0.
  • Finally, there's a minor code cleanup of the generator.

Closes #18267

Validation Steps Performed

  • Unit tests ✅
  • Thai does not have random gaps anymore due to ZWSP ✅


// U+2500 to U+257F: Box Drawing block
// U+2580 to U+259F: Block Elements block
// By default, CharacterWidth.Ambiguous, but by convention .Narrow in terminals.
Copy link
Member

Choose a reason for hiding this comment

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

oh no. i now realize that conhost may have expected these to be Ambiguous - in applications that target CJK and do box drawing. i can't remember...

@carlos-zamora carlos-zamora merged commit 0961a77 into main Dec 5, 2024
20 checks passed
@carlos-zamora carlos-zamora deleted the dev/lhecker/18267-zwsp branch December 5, 2024 21:38
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.

ZWSP (\U200B) is rendered as a space when in 'grapheme clusters' mode
3 participants