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

Some emoji is missing #10

Open
aleksandrshoshiashvili opened this issue Apr 10, 2018 · 3 comments
Open

Some emoji is missing #10

aleksandrshoshiashvili opened this issue Apr 10, 2018 · 3 comments

Comments

@aleksandrshoshiashvili
Copy link

aleksandrshoshiashvili commented Apr 10, 2018

For example: ⏰⌛️💳🆙...

I suggest to update switch:

switch value {
        case 0x1F600...0x1F64F,
             0x1F300...0x1F5FF,
             0x1F680...0x1F6FF,
             0x1F1E6...0x1F1FF,
             0x2600...0x26FF,
             0x2700...0x27BF,
             0xFE00...0xFE0F,
             0x1F900...0x1F9FF,
             65024...65039,
             8400...8447,
             9100...9300,
             127000...127600:
            return true
        default:
            return false
        }
Francescu added a commit that referenced this issue Apr 10, 2018
Francescu added a commit that referenced this issue Apr 10, 2018
This fix might be a partial fix
@Francescu
Copy link
Collaborator

Thanks @aleksandrshoshiashvili

I pushed a first fix for this.

When I tried

XCTAssertEqual(Smile.extractEmojis(string: "Hello ⏰⌛️💳🆙."), "⏰⌛️💳🆙")

I got

XCTAssertEqual failed: ("⏰️💳🆙") is not equal to ("⏰⌛️💳🆙")

Only ⌛️ seems to bug.

Which function failed with the other emojis?

Also, thanks a lot for the unicode ranges! Where did you get those from?

@aleksandrshoshiashvili
Copy link
Author

@Francescu I tested the validator for TextField by entering all the emoji one by one, so I found out that Smile.isEmoji returned wrong result for some of them. I printed their unicodes and update switch according to it :)

Unfortunately, I forgot what exactly the emoji are wrong, because I did it couple of weeks ago, just decided to share my finding with you.

@Francescu
Copy link
Collaborator

@aleksandrshoshiashvili wow, nice! Thanks a lot for the answers.

I'll dig more and use the isEmoji function to tests the emojis.

onmyway133 added a commit that referenced this issue Aug 23, 2018
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

2 participants