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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse broken for flag emoji #3

Open
zacharysyoung opened this issue Jun 14, 2022 · 0 comments
Open

Reverse broken for flag emoji #3

zacharysyoung opened this issue Jun 14, 2022 · 0 comments

Comments

@zacharysyoung
Copy link

zacharysyoung commented Jun 14, 2022

Inspired by a comment on this SO about string-reversal in Python:

For example, "🇬🇧"[::-1] yields "🇧🇬".

I thought I'd try your Reverse() func:

assert.Equal(t, Reverse("🇬🇧"), "🇬🇧")

and I got:

Error Trace:	xstrings_test.go:86
    
Error:      	Not equal: 
    
                expected: "🇧🇬"
    
                actual  : "🇬🇧"
    
Test:       	TestReverse

Flags are special in that they are specific ordering of two letters to designate the ISO-3166 country code, which for some systems and fonts is rendered as that country's flag1:

Regional indicator symbols
These characters can be used in pairs to represent regional
codes. In some emoji implementations, certain pairs may be
recognized and displayed by alternate means; for instance,
an implementation might recognize F + R and display this
combination with a symbol representing the flag of France

Footnotes

  1. https://www.unicode.org/charts/PDF/U1F100.pdf

@zacharysyoung zacharysyoung changed the title Reverse broken for single, modified emoji Reverse broken for flag emoji Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant