swiftmailer/swiftmailer — pull request #124 by ganchiku (2011-10-19 15:15:32+00:00)
Title: fixed header encoding for Japanese iso-2022-jp(JIS)

Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Swiftmailer tests pass: yes
Fixes the following tickets: #122

If the encoded texts(body and subject or other texts requires encoding) were passed when assembling the mail data, this breaks backwards compatibility, because the encoding process is now in the source code. The reason why putting encoding in the library is that "tokenNeedsEncoding" in Swift_Mime_Headers_AbstractHeader does not work with encoded string.

Also usual base64_encode cannot work for this problem, since splitting to 76 characters cannot split properly. Added special method for iso-2022-jp, which is not too clean, but cleaner than using mb_encode_mimeheader since mb_encode_mimeheader requires temporal change for mb_internal_encoding.