mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-26 04:57:51 +00:00
`.sort(…, charset: "UTF-8 ALL\r\nA2 DELETE INBOX\r\nA3 SEARCH", …)` was written verbatim, injecting a command into SORT / SEARCH / ESEARCH. `.badCharset(["a)] x\r\n* BYE"])` injected a response. Quoted names also didn't round-trip: `"a b"` parsed, then encoded bare. RFC 3501: `charset = atom / quoted`. New `CharacterSetName` replaces `String`; valid = non-empty `TEXT-CHAR`. Written as an atom where it is one (`CHARSET UTF-8` unchanged), quoted otherwise, never a literal. The parser rejects quoted names it couldn't write back.