email subject utf-8 encoding
Posted: Mon Jan 28, 2013 2:58 pm
Hi,
The default language of my cart is not English, but Korean, and the cart version is 1.5.4.1.
If the order is complete, the cart sends an email by "system/library/mail.php".
If the protocol is "mail", it encodes the subject correctly as follows:
However, it does not encode the subject if the protocol is "smtp" (not "mail").
I believe that most of non-English mail clients will try to decode the subject in their own language character set if not specified. Of course, it shows broken title.
I changed the line:
into
It works fine.
Please, consider the core code update. Thank you.
The default language of my cart is not English, but Korean, and the cart version is 1.5.4.1.
If the order is complete, the cart sends an email by "system/library/mail.php".
If the protocol is "mail", it encodes the subject correctly as follows:
Code: Select all
if ($this->protocol == 'mail') {
ini_set('sendmail_from', $this->from);
if ($this->parameter) {
mail($to, '=?UTF-8?B?' . base64_encode($this->subject) . '?=', $message, $header, $this->parameter);
} else {
mail($to, '=?UTF-8?B?' . base64_encode($this->subject) . '?=', $message, $header);
}
Code: Select all
if ($this->protocol != 'mail') {
$header .= 'To: ' . $to . $this->newline;
$header .= 'Subject: ' . $this->subject . $this->newline;
}
I changed the line:
Code: Select all
$header .= 'Subject: ' . $this->subject . $this->newline;
Code: Select all
$header .= 'Subject: ' . '=?UTF-8?B?' . base64_encode($this->subject) . '?=' . $this->newline;
Please, consider the core code update. Thank you.