Skip to content

0.1.0

Latest

Choose a tag to compare

@coenttb coenttb released this 12 Nov 15:48
· 4 commits to main since this release

WHATWG URL Encoding v0.1.0

Initial release of swift-whatwg-url-encoding, implementing the WHATWG URL Standard for application/x-www-form-urlencoded encoding.

Features

  • serialize() - Convert name-value pairs to URL-encoded string
  • parse() - Parse URL-encoded string to name-value pairs
  • percentEncode() - WHATWG-compliant percent encoding (space → +)
  • percentDecode() - Handles + as space and UTF-8 multi-byte characters
  • Character set - Only alphanumeric + *-._ left unencoded
  • UTF-8 support - Proper handling of multi-byte characters
  • Swift 6.0 - Full strict concurrency support

Differences from Foundation

  • Space encoding: + (WHATWG) vs %20 (Foundation)
  • Character set: Strict WHATWG compliance vs Foundation's permissive encoding
  • Specification: Exact implementation of WHATWG URL Living Standard

Requirements

  • Swift 6.0+
  • macOS 14.0+, iOS 17.0+, tvOS 17.0+, watchOS 10.0+

Reference

WHATWG URL Living Standard - application/x-www-form-urlencoded