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

there's zwnj too #4

Open
simevo opened this issue Nov 22, 2016 · 3 comments
Open

there's zwnj too #4

simevo opened this issue Nov 22, 2016 · 3 comments

Comments

@simevo
Copy link

simevo commented Nov 22, 2016

Related to #2, there is also zero-width non-joiners (ZWNJ).

I'm in the process of packaging string-width in Debian, and as a low-cost, acceptable solution to all these problems I propose to replace the dependency on is-fullwidth-code-point with wcwidth.js. This patch does the trick:
https://anonscm.debian.org/git/pkg-javascript/node-string-width.git/tree/debian/patches/01-wcwidth.diff

We've created a minimal test suite of strings with zwj and zwnj, you can find it here:
https://anonscm.debian.org/git/pkg-javascript/node-string-width.git/tree/debian/patches/02-test_zwj_zwnj.diff
[sorry we also switched from ava to mocha since ava is not available yet in Debian ...; run them with mocha -u tdd]

As pointed out in #2, the right number of columns required to display an emoji zwj sequence is debatable, so the tests are only there to guarantee we're at least reproducible.

@Offirmo
Copy link

Offirmo commented Sep 22, 2017

@simevo I'm having a look at this issue. How did you make up the expected sizes in the proposed unit tests? (it's not on the wikipedia page)

@simevo
Copy link
Author

simevo commented Sep 22, 2017

All those tests pass with the string-width library as it is, so they are there only to confirm reproducible behavior. The right number of columns required to display some of those sequence is debatable and probably not unique.

@Offirmo
Copy link

Offirmo commented Sep 22, 2017

Thanks.

is debatable and probably not unique

That's what I feared. Thus I won't integrate those unit tests while I'm not sure of what I'm doing. I'll copy the one I understand (emojis ;))

Thanks a lot for sharing!

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

No branches or pull requests

2 participants