The title of the newsletter is not being encoded correctly, as the conversion of UTF8 into quoted printable (=xx) and the encapsulation into =?utf-8?Q?...= is missing.

For example, a subject of "Jörg" should be encoded as "=?utf-8?Q?J=c3=b6rg?=", but isn't.

Comments

ralphb’s picture

Version: 4.6.x-1.x-dev » 7.x-1.x-dev

After reading through the PHP documentation and the activeMail code it seems that an RFC-compliant solution is currently not possible (this would involve a multi-line subject header, see RFC 2047). In the interim, we could at least use some proper encoding but keep everything in one single line:

function sn_mail_enc_subj($subject) {
  $escd = preg_replace('/[^\x09\x20-\x3C\x3E-\x7E]/e',
                       'sprintf("=%02X", ord("$0"));', $subject);
  $escd = str_replace(' ', '_', $escd);
  return "=?utf-8?q?" . $escd . "?=";
}

Then replace

  $email->Subject($mail->title);

by

  $email->Subject(sn_mail_enc_subj($mail->title));

This fixes display issues in at least mutt and Thunderbird (on OSX).

mightyiam’s picture

Is this still open??

sutharsan’s picture

Status: Active » Closed (fixed)

Issue closed. No response for too long time.