ZF-10710: Japanese subject garbled (mojibake) in Mac Mail, Yahoo Mail for long strings

Description

When using Zend_Mail with a multibyte subject over 72 characters long the _encodeHeader function calls Zend_Mime::encodeBase64Header function which then calls the Zend_Mime::encodeBase64 function.

The Zend_Mime::encodeBase64 function performs a chunk_split on the base64 encoded subject. This results in an unreadable garbled subject (known as mojibake in Japanese) in the Mac Mail application and in Yahoo Web Mail.

If the chunk_split from the is removed from the Zend_Mime::encodeBase64 function the subject is output as expected in all Mail software.

This has occurred with UTF-8 emails.

Comments

Can you please provide a few strings that currently fail for you? (that is, the input string, and the expected output string)

The following in the subject, the to name, from name, cc name will cause the header to become corrupted.

テストテストテストテストテストテストテストテストテストテストテストテストテスト

This just says

testtesttesttesttesttesttesttesttesttesttesttesttesttest

Thanks