MimeParser
MimeParser copied to clipboard
Encoded words support
First of all thank you for this library. I've used it to retrieve some headers, and I stumbled upon a header that contained UTF-8 data, is there a way to decode this header using this library ?
Format seems to be ?=encoding?charset?mytexthere?=
Thank you.
Seems to be documented in this RFC:
https://www.rfc-editor.org/rfc/rfc2047.html
I would also like to see this added. There is some code here that may be a good starting point:
https://github.com/bengottlieb/marcel/blob/master/Source/Marcel/String%2BMime.swift
I had to fix this code like so:
while let range = result.range(of: utf, options: .caseInsensitive),
let endRange = result[range.upperBound...].range(of: utfEnd),
range.upperBound < endRange.lowerBound, !done {