|Subject:||Stranded strings with combiners or ZWJ on borders break my NFG expectations ( (“\xa” x 2).chars.say )|
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\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.