Uploaded image for project: 'Swift'
  1. Swift
  2. SR-2956

CharacterSet union and formUnion not working properly in Swift 3 with unicode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Foundation
    • Labels:
    • Environment:

      Mac OS Sierra 10.12
      Xcode 8.0 (8a218a)
      Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
      Target: x86_64-apple-macosx10.9

      Description

      You can reproduce with the following code: https://gist.github.com/twobitlabs/5ba150aed3c159d215ef049f0c5739de

      import Foundation
      var charset = CharacterSet(charactersIn: "a")
      charset.formUnion(CharacterSet(charactersIn: "\u{1F600}"))
      print(charset.contains("\u{1F600}")) // prints false but should print true
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            thuss Todd Huss
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: