There are a number of bugs in qp_encode:
When in no_softbreak mode it eats the last character.
When in encoded_word mode it:
- inserts softbreaks for lines over 72 chars
- does not encode underscores leading to them being
decoded as spaces
- does not encode question marks, potentially leading to
badly broken encoded words
- does not encode tabs
I have attached a patch to fix these and also to test them
and a couple of other RFC2047 requirements. With regard to
softbreaks in encoded words it's still not legal to just let
them ron on as an encoded word is not meant to be longer
than 75 characters itself. I'll file a bug report and patch for
that soon.
Matthew
unified diff with fixes and tests