|
|
|
|
|
by hahainternet
3952 days ago
|
|
I'm not quite sure how to interpret the output as it doesn't render particularly kindly in my terminal: sub MAIN($s) {
say "{$s.chars}: $s";
my $b = $s.substr(0,12);
say "{$b.chars}: $b";
}
$ perl6 hn-test2.p6 देवनागरीदेवनागरी
16: देवनागरीदेवनागरी
12: देवनागरीदेवन
|
|
The new string is composed of 10 user-visible characters (5 character repeated twice) but 16 codepoints (and this time I carefully checked that there was no precomposed version):
Operating on codepoints, both versions cut after the second DEVANAGARI LETTER NA (न) breaking that grapheme cluster (it should be ना) and not displaying the final two clusters ग and री.