Skip to content

encoding: add lenientQPReader to handle malformed quoted-printable encoding#199

Open
dejanstrbac wants to merge 1 commit intoemersion:masterfrom
migadu:lenientqp
Open

encoding: add lenientQPReader to handle malformed quoted-printable encoding#199
dejanstrbac wants to merge 1 commit intoemersion:masterfrom
migadu:lenientqp

Conversation

@dejanstrbac
Copy link
Copy Markdown

Go's strict mime/quotedprintable decoder rejects slightly malformed QP encoding (= sequences).
RFC 2045 says implementations should be lenient. We encode the '=' as '=3D' so the standard QP decoder will decode it as a literal '=' character.

6.7. Quoted-Printable Content-Transfer-Encoding, Page 21, section 2:

      An "=" followed by a character that is neither a
      hexadecimal digit (including "abcdef") nor the CR
      character of a CRLF pair is illegal.  This case can be
      the result of US-ASCII text having been included in a
      quoted-printable part of a message without itself
      having been subjected to quoted-printable encoding.  A
      reasonable approach by a robust implementation might be
      to include the "=" character and the following
      character in the decoded data without any
      transformation and, if possible, indicate to the user
      that proper decoding was not possible at this point in
      the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants