Problem
On WASI/WebAssembly, parsing RFC 822 date formats fails because DateFormatter requires ICU (International Components for Unicode) locale data to parse month abbreviations and day names. This data is limited or unavailable in WASM builds due to 256MB memory constraints.
Example
let dateDecoder = DateFormatterDecoder.RSS.decoder
let result = dateDecoder.decodeString("Fri, 06 Oct 2017 17:21:35 +0000")
// result is nil on WASI, but works on other platforms
Root Cause
The RFC 822 format string "E, d MMM yyyy HH:mm:ss zzz" includes:
E - Day name (e.g., "Fri")
MMM - Month abbreviation (e.g., "Oct")
Both require locale data from ICU to parse correctly.
Current Workaround
Test testDateDecoderRFC822 is skipped on WASI platform using XCTSkip.
Potential Solutions
- Custom FormatStyle (preferred): Create an RFC822FormatStyle that manually maps month abbreviations without ICU dependency
- Manual parser: Implement string parsing logic without DateFormatter
- Conditional compilation: Use different parsing strategy on WASI vs other platforms
References
- Failing test:
Tests/SyndiKitXCTests/WordpressTests.swift - testDateDecoderRFC822()
- Date decoder:
Sources/SyndiKit/Decoding/DateFormatterDecoder.swift
- Real-world examples:
Data/WordPress/articles.xml contains RSS feeds with RFC 822 dates
Impact
- RSS feeds with RFC 822
pubDate fields cannot be parsed on WASI
- WordPress export files use this format extensively
- Other date formats (ISO 8601, WordPress numeric format) work fine on WASI
Problem
On WASI/WebAssembly, parsing RFC 822 date formats fails because
DateFormatterrequires ICU (International Components for Unicode) locale data to parse month abbreviations and day names. This data is limited or unavailable in WASM builds due to 256MB memory constraints.Example
Root Cause
The RFC 822 format string
"E, d MMM yyyy HH:mm:ss zzz"includes:E- Day name (e.g., "Fri")MMM- Month abbreviation (e.g., "Oct")Both require locale data from ICU to parse correctly.
Current Workaround
Test
testDateDecoderRFC822is skipped on WASI platform usingXCTSkip.Potential Solutions
References
Tests/SyndiKitXCTests/WordpressTests.swift-testDateDecoderRFC822()Sources/SyndiKit/Decoding/DateFormatterDecoder.swiftData/WordPress/articles.xmlcontains RSS feeds with RFC 822 datesImpact
pubDatefields cannot be parsed on WASI