The Regional Indicator Symbols (Flag emoji) sometimes work as expected when flipped, sometimes not.
say my $um = '馃嚞馃嚙 is not 馃嚙馃嚞';
say $um.flip;
Output:
馃嚞馃嚙 is not 馃嚙馃嚞
馃嚞馃嚙 ton si 馃嚞馃嚙
"馃嚞 馃嚙馃嚙馃嚞".flip.say;
Output:
馃嚞馃嚙馃嚙 馃嚞
Tested on Camelia ce5a01137 (see http://colabti.org/irclogger/irclogger_log/perl6?date=2018-08-10#l896)
and on random dev build:
2018.06-255-gd471bf7 built on MoarVM version 2018.06-314-g4199a95
This used to work in the past.
Bisected: (2017-06-10) https://github.com/rakudo/rakudo/commit/56e71d5925ec51a2593943066c6a4041a406cfeb
That second one might fall under the DIHWIDT clause, but I really thought the first should work.
Will have to take a look at this. It looks like the code that tries to count if we have 2 or 3 Regional Indicators and segment them is buggy. I'm guessing that it's not resetting the count and so it causes a break after the third Regional Indicator it sees (since RI are segmented at 2 or at 3 codepoints).
I have fixed this bug in https://github.com/MoarVM/MoarVM/commit/829b8ee70 see commit information for full description on the issue. rakudo/nqp should be bumped to get the fix once Travis is clean on MoarVM
Tests have been added here: https://github.com/perl6/roast/commit/0a5ff6b14e3b9491a883a948c6859de239d73918
Going to close the issue now. It can be reopened but I believe this issue and other bugs I found with regional indicators have now been fixed :+1: