rust-email icon indicating copy to clipboard operation
rust-email copied to clipboard

Support RFC2047 encoding on Header's to_string

Open niax opened this issue 10 years ago • 1 comments

Headers should (as required) use RFC2047 encoding when being coerced into a string for inclusion in a MimeMessage.

It should:

  • [ ] Support determination of charset encoding as determined by the user, but default to UTF-8
  • [ ] Decide automagically if it should use Q encoding or BASE64, based on whichever is shorter
  • [ ] Play nicely with header folding (Perhaps ToFoldedHeader should have a requirement to have handled encoding yourself)
  • [ ] Not need to do any special manipulation to strings that are already 7-bit ASCII.

niax avatar Dec 05 '14 18:12 niax

I'm two layers downstream and needed this, so I implemented an RFC 2047 encoder. It doesn't tick all of the boxes from above yet, but I believe it does q-encoding correctly, which should cover the hardest part: https://crates.io/crates/rfc2047

Valodim avatar Oct 03 '19 16:10 Valodim