Releases: swift-standards/swift-rfc-3987
Releases · swift-standards/swift-rfc-3987
0.2.0
0.1.0 - Initial Release
swift-rfc-3987 0.1.0
Swift implementation of RFC 3987: Internationalized Resource Identifiers (IRIs)
Features
- ✅ IRI validation with Unicode support
- ✅ IRI normalization (scheme/host lowercasing, port removal, path normalization)
- ✅ IRI to ASCII string conversion (percent-encoding)
- ✅ Protocol-based design with
IRI.Representable - ✅ Foundation
URLconformance toIRI.Representable - ✅ Swift 6.0 strict concurrency support
- ✅ Full
Sendableconformance - ✅ Comprehensive test suite (34 tests in 6 suites)
API Highlights
// Create IRIs with validation
let iri = try RFC_3987.IRI("https://example.com/寿司")
// Normalize IRIs
let normalized = iri.normalized()
// Convert to ASCII-compatible string
let asciiString = iri.uriString // "https://example.com/%E5%AF%BF%E5%8F%B8"
// Foundation URL interoperability
let url = URL(string: "https://example.com")!
let iri = RFC_3987.IRI(url: url)Developer Experience
- LocalizedError conformance with helpful error messages
- CustomDebugStringConvertible for better debugging
- Idiomatic Swift API design (properties over methods)
- Convenience initializers for common use cases
Installation
dependencies: [
.package(url: "https://github.com/swift-web-standards/swift-rfc-3987", from: "0.1.0")
]Requirements
- Swift 6.0+
- macOS 14+, iOS 17+, tvOS 17+, watchOS 10+