Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Regional Indicator Symbols seem to get mangled when flipped sometimes #2198

Closed
thundergnat opened this issue Aug 10, 2018 · 5 comments
Closed
Assignees
Labels
regression Issue did not exist previously tests needed Issue is generally resolved but tests were not written yet Unicode Related to unicode support

Comments

@thundergnat
Copy link
Contributor

thundergnat commented Aug 10, 2018

The Problem

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 ce5a011 (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

@AlexDaniel AlexDaniel added Unicode Related to unicode support regression Issue did not exist previously labels Aug 10, 2018
@AlexDaniel
Copy link
Contributor

This used to work in the past.

Bisected: (2017-06-10) 56e71d5

@thundergnat
Copy link
Contributor Author

That second one might fall under the DIHWIDT clause, but I really thought the first should work.

@samcv
Copy link
Member

samcv commented Aug 11, 2018

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).

@samcv
Copy link
Member

samcv commented Aug 13, 2018

I have fixed this bug in MoarVM/MoarVM@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

@AlexDaniel AlexDaniel added the tests needed Issue is generally resolved but tests were not written yet label Aug 13, 2018
samcv added a commit to Raku/roast that referenced this issue Aug 13, 2018
We didn't have tests for this, now this should be pretty sufficient and
at least cover join and concatenation.

Tests should close out issue rakudo/rakudo#2198
@samcv
Copy link
Member

samcv commented Aug 13, 2018

Tests have been added here: Raku/roast@0a5ff6b

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 馃憤

@samcv samcv closed this as completed Aug 13, 2018
ugexe pushed a commit to Raku/roast that referenced this issue Dec 15, 2018
We didn't have tests for this, now this should be pretty sufficient and
at least cover join and concatenation.

Tests should close out issue rakudo/rakudo#2198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously tests needed Issue is generally resolved but tests were not written yet Unicode Related to unicode support
Projects
None yet
Development

No branches or pull requests

3 participants