I was wondering whether storing the bidirectional embedding level together
with *each* character would have resulted in an excessive increase in the
size of the edit buffer. 'Cause, as someone recently noted, "size DOES
matter".
But, checking in the bidirectional algorithm
(http://www.unicode.org/unicode/reports/tr9/tr9-8.html), I noted that the
maximum embedding levels is actually 61, not 64 as it was said.
This means that embedding levels may be packed in 6 bits, and this also
leaves two handy "illegal" levels, 62 and 63, available for internal usage
(e.g. "level not set", etc.).
But, if you consider that the maximum Unicode value (0x10FFFD) fits in 21
bits, it means that the upper *six* bits of a 32-bit character are always
unused, and could be recycled to store the embedding levels "WHERE WE NEED
AND WANT THEM!!" and at no cost.
_ Marco