-
Notifications
You must be signed in to change notification settings - Fork 188
Add an upcall point to swift-corelibs-foundation for String encoding conversion #1217
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
Add an upcall point to swift-corelibs-foundation for String encoding conversion #1217
Conversation
@swift-ci test |
Will, of course, need a follow up in swift-corelibs-foundation to replace the function with one that calls into |
@@ -91,6 +91,14 @@ extension UInt16 { | |||
|
|||
// These provides concrete implementations for String and Substring, enhancing performance over generic StringProtocol. | |||
|
|||
#if !FOUNDATION_FRAMEWORK | |||
@_spi(SwiftCorelibsFoundation) | |||
dynamic public func _cfStringEncodingConvert(string: String, using encoding: UInt, allowLossyConversion: Bool) -> Data? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a similar up-call for the bytes --> String
direction so that we support decoding as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done.
@swift-ci test |
@swift-ci test |
Add an upcall to swift-corelibs-foundation for converting String encodings that swift-foundation does not implement.
Partially resolves #1216.