Skip to content

Re-core some String APIs on swift-foundation #5009

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

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

jmschonfeld
Copy link
Contributor

This removes some String APIs in SCL-F in favor of those in swift-foundation and removes some !DEPLOYMENT_RUNTIME_SWIFT paths that are no longer relevant in this project. This depends on swiftlang/swift-foundation#739, so I'll update the commit hash in the package manifest and cmake files once that is merged before merging this

@@ -76,9 +76,9 @@ class TestDataURLProtocol: XCTestCase {
("data:;charset=utf-16;base64,2D3caCAN2D3caCAN2D3cZyAN2D3cZw==", "👨‍👨‍👧‍👧", (expectedContentLength: 22, mimeType: "text/plain", textEncodingName: "utf-16")),
("data:;charset=utf-16le;base64,Pdho3A0gPdho3A0gPdhn3A0gPdhn3A==", "👨‍👨‍👧‍👧", (expectedContentLength: 22, mimeType: "text/plain", textEncodingName: "utf-16le")),
("data:;charset=utf-16be;base64,2D3caCAN2D3caCAN2D3cZyAN2D3cZw==", "👨‍👨‍👧‍👧", (expectedContentLength: 22, mimeType: "text/plain", textEncodingName: "utf-16be")),
("data:application/json;charset=iso-8859-1;key=value,,123", ",123", (expectedContentLength: 4, mimeType: "application/json", textEncodingName: "iso-8859-1")),
// ("data:application/json;charset=iso-8859-1;key=value,,123", ",123", (expectedContentLength: 4, mimeType: "application/json", textEncodingName: "iso-8859-1")),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are temporarily disabled until we can enable the isoLatin1 encoding in swift-foundation or add an up-call to SCL-F to handle the extra encodings beyond the standard UTF encodings

@jmschonfeld jmschonfeld force-pushed the recore-string-data-encoding branch from e1234ba to c098501 Compare July 17, 2024 16:51
@@ -297,6 +212,7 @@ extension String {
/// frees the buffer.
///
/// - Warning: This initializer is not memory-safe!
@available(swift, deprecated: 6.0, message: "String does not support no-copy initialization")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These (and the other deprecated functions) are now deprecated on Darwin, so this updates these to match Darwin

//
// This file is shared between two projects:
//
// 1. https://github.com/apple/swift/tree/master/stdlib/public/Darwin/Foundation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file no longer exists / this is no longer the case, so we can remove this comment altogether

@jmschonfeld jmschonfeld force-pushed the recore-string-data-encoding branch from c098501 to 08744fc Compare July 17, 2024 17:34
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Linux platform

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Windows platform

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Linux platform

1 similar comment
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Linux platform

@jmschonfeld jmschonfeld merged commit 15ee5c3 into swiftlang:main Jul 18, 2024
2 checks passed
@jmschonfeld jmschonfeld deleted the recore-string-data-encoding branch July 18, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants