Swift-foundation now available

Hey @YOCKOW - you're right that function doesn't seem to have a Swift equivalent in our current APIs. For functions in CoreFoundation that are useful in the Swift ecosystem, I think the best approach (as you mentioned) is to publish them as official Swift APIs rather than continue to call to CoreFoundation to use them (that way eventually they can be removed from CoreFoundation in swift-corelibs-foundation). This one in particular seems relatively simple in implementation and is actually already partially implemented (but not public) in swift-foundation since we use it when writing strings to files. I think this would be a great opportunity for a pitch for new API for FoundationEssentials. We actively review and bring in new APIs to Foundation - you can see some of the other pitches posted to this category for inspiration. I'm happy to help with the process if you or any others would like to start up a pitch thread for it! I think this could fit very nicely as new API for String.Encoding.

4 Likes