Swift unicode parsing irregularities with regional indicator symbols

Originator:colin.myr
Number:rdar://18949040 Date Originated:11-Nov-2014 08:08 PM
Status:Open Resolved:
Product:Swift Product Version:1.1
Classification:Bug Reproducible:Always
 
Summary:
when enumerating over a string, multiple (any?) combinations of regional indicator symbols are returned at an enumeration if they appear in sequence.

Steps to Reproduce:
let godHatesFlags = "MMM🇯🇵🇰🇷🇩🇪🇨🇳🇺🇸🇫🇷🇪🇸🇮🇹🇷🇺🇬🇧!"
for item in godHatesFlags {
println(item)
}


Expected Results:
M
M
M
🇯🇵
🇰🇷
🇩🇪
🇨🇳
🇺🇸
🇫🇷
🇪🇸
🇮🇹
🇷🇺
🇬🇧

Actual Results:
M
M
M
🇯🇵🇰🇷🇩🇪🇨🇳🇺🇸🇫🇷🇪🇸🇮🇹🇷🇺🇬🇧

Version:
Xcode 6.1(6A1052c), 10.10

Notes:
I mean, Unicode *is* tricky, no doubt

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!