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

Improve handling of combining characters #11

Merged
merged 2 commits into from
Sep 14, 2015
Merged

Conversation

philipc
Copy link
Contributor

@philipc philipc commented Sep 2, 2015

This addresses issue #10

  • wcwidth() for combining characters is now 0
  • widths for general categories Mc and Me are improved

Previously, the canonical combining class was used to determine
which characters are zero width combining characters. This had
two problems:
- it classified spacing marks (category Mc) as zero width
- it classified enclosing marks (category Me) as normal characters

Fix by using the general category to generate a table of combining
characters that have zero width. Characters with a general category
of Mn or Me are included in this table. Characters with a general
category of Mc are not included, and so use the default width of 1.
@jquast
Copy link
Owner

jquast commented Sep 12, 2015

This is Fantastic work @philipc !

I will Changelog and release soon!

@jquast
Copy link
Owner

jquast commented Sep 13, 2015

Finished review, very great work, thank you so much !

@jquast jquast merged commit 72ef7fe into jquast:master Sep 14, 2015
jquast added a commit that referenced this pull request Sep 14, 2015
@philipc
Copy link
Contributor Author

philipc commented Sep 14, 2015

Thanks for the review and merge.

I should have mentioned that I left the COMBINING table in because the scripts in bin needed it still. I agree that we should remove it from the main library, but I wasn't sure of the best way to do that and keep the test scripts working.

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.

None yet

2 participants