Swift: Multiple emoji flags have a character count of 1
| Originator: | liu.dongyuan | ||
| Number: | rdar://21374653 | Date Originated: | 14-Jun-2015 00:41 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | |
| Classification: | Reproducible: | Always |
Summary: In Swift, a string consists of multiple emoji flags has a character count of 1 Steps to Reproduce: In Swift 1: var str = "🇨🇳🇯🇵🇰🇷🇨🇳🇯🇵🇰🇷🇨🇳🇯🇵🇰🇷" print(count(str)) In Swift 2: var str = "🇨🇳🇯🇵🇰🇷🇨🇳🇯🇵🇰🇷🇨🇳🇯🇵🇰🇷" print(str.characters.count) Expected Results: The string actually has a character count of 9, so it should print 9. Actual Results: It prints 1.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!