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

Variation selectors are not correctly handled #45

Closed
Frederick888 opened this issue Aug 20, 2020 · 5 comments
Closed

Variation selectors are not correctly handled #45

Frederick888 opened this issue Aug 20, 2020 · 5 comments
Labels

Comments

@Frederick888
Copy link

Variation selectors (U+FE0E, U+FE0F) can change column widths of some preceding characters. For example, U+270F (✏) is a single-column glyph by itself, but with a succeeding U+FE0F it occupies 2 columns as shown in the snapshot below.

image

@Frederick888
Copy link
Author

Sorry I just went through the README. Is such kind of cases not supposed to be handled by this package?

@jquast
Copy link
Owner

jquast commented Aug 20, 2020

This is a new one to me, yes, if iTerm and libvte-based terminals support it, then so should wcwidth! Thank you

@Frederick888
Copy link
Author

Frederick888 commented Aug 21, 2020

@jquast Then I'm afraid this is not the only case... There are also for example, Emoji Modifier Sequences, Zero-Width Joiner (and etc?).

Unicode is crazy lol...

image

@jquast
Copy link
Owner

jquast commented Aug 22, 2020

Multi codepoint emoji's covered in #39, zero-width joiners are sort of in 2 different issues.. Yes, Unicode 6.0 was so much easier when this project started :)

@jquast jquast added the bug label Jan 29, 2021
jquast added a commit that referenced this issue Oct 30, 2023
Major
-----

Bugfix zero-with characters, closes #57, #47, #45, #39, #26, #25, #24, #22, #8, wow !

This is mostly achieved by replacing `ZERO_WIDTH_CF` with dynamic parsing by Category codes in bin/update-tables.py and putting those in the zero-wide tables.

Tests
-----

- `verify-table-integrity.py` exercises a "bug" of duplicated tables that has no effect, because wcswidth() first checks for zero-width, and that is preferred in cases of conflict. This PR also resolves that error of duplication.
- new automatic tests for balinese, kr jamo, zero-width emoji, devanagari, tamil, kannada.  
- added pytest-benchmark plugin, example use:

        # baseline
        tox -epy312 -- --verbose --benchmark-save=original
        # compare
        tox -epy312 -- --verbose --benchmark-compare=.benchmarks/Linux-CPython-3.12-64bit/0001_original.json
@jquast
Copy link
Owner

jquast commented Oct 30, 2023

I have verified that this example in particular is fixed by #91 in today's release, thank you

@jquast jquast closed this as completed Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants