Improve handling of combining characters by philipc · Pull Request #11 · jquast/wcwidth (original) (raw)
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.
This is Fantastic work @philipc !
I will Changelog and release soon!
Finished review, very great work, thank you so much !
jquast added a commit that referenced this pull request
This was referenced
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.