Avatar
norio_nomura 1/31/2019 2:47 AM
Swift 5のString.UnicodeScalarsView.map(_:)でクラッシュ https://bugs.swift.org/browse/SR-9822 @swift-4.2.4 @swift-5.0.3 -frontend -repl // https://emojipedia.org/family-man-woman-girl-boy/ let family = "\u{1f468}\u{200d}\u{1f469}\u{200d}\u{1f467}\u{200d}\u{1f466}" let utf8Index = family.utf8.index(before: family.utf8.endIndex) let utf8Before = String(family[..<utf8Index]) _ = utf8Before.unicodeScalars.map { $0 } (edited)