You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
```
let nstring: NSString = "абВГ"
let mCopy = CFStringCreateMutableCopy(kCFAllocatorSystemDefault, 0, nstring)
```
`mCopy._swiftObject` is now "аб".
CFStringCreateMutableCopy -> __CFStringReplace:
For NSString type: CFStringGetLength() relies on NSString.length (_storage.utf16.count) - this is 4 and __CFStrIsUnicode(str) is false - as a result only half string is copied.
This problem not exists in Xcode 7.1.1 (7B1005) that's why I think it is bug here.
__CFStrIsUnicode is no longer invoked on NSCFStrings in this code path, and it now queries the string for it's storage via _encodingCantBeStoredInEightBitCFString which should properly report the string to be абВГ in this case. It passes on both Mac OS X and Linux targets
Additional Detail from JIRA
md5: dd84e00ecea160eade3b3808ece9fbb2
Issue Description:
```
let nstring: NSString = "абВГ"
let mCopy = CFStringCreateMutableCopy(kCFAllocatorSystemDefault, 0, nstring)
```
`mCopy._swiftObject` is now "аб".
CFStringCreateMutableCopy -> __CFStringReplace:
For NSString type: CFStringGetLength() relies on NSString.length (_storage.utf16.count) - this is 4 and __CFStrIsUnicode(str) is false - as a result only half string is copied.
This problem not exists in Xcode 7.1.1 (7B1005) that's why I think it is bug here.
ref: https://github.com/krzyzanowskim/swift-corelibs-foundation/commit/3039562d0ccae6f0f877df79aada27781c232646#commitcomment-14810527
The text was updated successfully, but these errors were encountered: