# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #131801]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131801 >


Code:
say (“\c[COMBINING OVERLINE]a” x 2).chars

Result:
4


Code:
say (“\c[COMBINING OVERLINE]a” ~ “\c[COMBINING OVERLINE]a”).chars

Result:
3



Both should produce the same result (3). What happens here is “a” on one side 
is not being squished into one grapheme with a combiner on another side.

Please note that combiners are not the only thing can cause this. Here is the 
same thing with ZWJ:

Code:
my $x = “\x[2695]\x[FE0F]a\x[1F468]\x[200D]”;
say ($x ~ $x).chars;
say ($x x 2).chars


Result:
5
6




I have a feeling that this is a known issue, and that there might be a ticket 
for this already. However, I couldn't find it.

Reply via email to