wcwidth icon indicating copy to clipboard operation
wcwidth copied to clipboard

Variation selectors are not correctly handled

Open Frederick888 opened this issue 5 years ago • 4 comments

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 avatar Aug 20 '20 08:08 Frederick888

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

Frederick888 avatar Aug 20 '20 08:08 Frederick888

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

jquast avatar Aug 20 '20 14:08 jquast

@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

Frederick888 avatar Aug 21 '20 09:08 Frederick888

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 avatar Aug 22 '20 10:08 jquast

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

jquast avatar Oct 30 '23 19:10 jquast