New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-2956] CharacterSet union and formUnion not working properly in Swift 3 with unicode #4318
Comments
The issue is still present in Xcode 9.3 beta 2. Also, note that .insert can be used to demonstrate the same problem (maybe union uses insert):
And this:
And this:
And this:
Since the following is working as expected no matter the order of a and b, maybe the problem is in how the ...(charactersIn: String) separates the String into unicode scalars?
Seems like it has problems handling supplemental code points:
|
@itaiferber, @parkera @phausler What is the semantics of CharacterSet exactly? The description: "A set of Unicode character values for use in search operations." implies that it can at least store unicode scalar values, but this behavior makes it look like it can only store UTF-16 code units. Is this a bug and can it be fixed, or is this the (undocumented) semantics of CharacterSet? |
this is undocumented semantics where we just don't trap on invalid characters. |
Could you define character? Is that restricted to BMP scalar? |
@milseman |
Can we at least document the fact that CharacterSet is only for use with BMP scalars? |
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
Additional Detail from JIRA
md5: eea36f50a39958f934a3b2a2adf3ded2
Issue Description:
You can reproduce with the following code: https://gist.github.com/twobitlabs/5ba150aed3c159d215ef049f0c5739de
The text was updated successfully, but these errors were encountered: