Why are emoji characters like 👩👩👧👦 treated so strangely in Swift strings?
问题 The character 👩👩👧👦 (family with two women, one girl, and one boy) is encoded as such: U+1F469 WOMAN, U+200D ZWJ, U+1F469 WOMAN , U+200D ZWJ , U+1F467 GIRL, U+200D ZWJ , U+1F466 BOY So it's very interestingly-encoded; the perfect target for a unit test. However, Swift doesn't seem to know how to treat it. Here's what I mean: "👩👩👧👦".contains("👩👩👧👦") // true "👩👩👧👦".contains("👩") // false "👩👩👧👦".contains("\u{200D}") // false "👩👩👧👦".contains("👧") // false "👩👩👧👦".contains("👦")