PƔdraig Brady wrote:
> In the first 65535 code points there are also 404 chars which are
> not classed as combining in the unicode database, but are classed
> as zero width in the glibc locale data at least (zero-width space
> being one of them like you mentioned). I determined this with the
> attached progs:
>
> ./zw | python unidata.py | grep " 0 " | wc -l
Hi PƔdraig,
Wow, I knew there were some stand-alone zero-width characters, but I had
no idea there were so many!
I poked around a little in gnulib and found a function for determining
the combining class of a Unicode character.
I think the attached patch does what you were intending to do, and it
also counts all of the stand-alone zero-width characters you found:
----
$ ./zw | python unidata.py | grep " 0 " | perl packu.pl | src/wc -m
404
$ src/wc -m 2char
2 2char
----
Please note that this requires a re-run of `./bootstrap', since it needs
to bring some extra stuff in from gnulib.
Hope that helps.
Bo