mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We already try using `CFStringGetCStringPtr` to see if we can get ASCII; we should also try `CFStringGetCharactersPtr` as the native encoding of `CFNSString` is very often UTF-16. While we're at it, try asking explicitly for UTF-8 as well. That won't work for `CFNSString` because AFAIK it's currently never encoded that way, but it might work if something hands us a Swift-backed string or if some future implementation of `CFString` happens to support UTF-8 encoded data. rdar://124913332