大概找到原因了!!
底下是收到的郵件內容:
Subject: =?utf-8?Q?=E6=96=B0=E7=99=BC=E8=A1=A8=E4=B8=BB=E9=A1=8C: =E5=AE=98=E6=96=B9 FAQ's?=
From: "綠光森林" <admin@capriskye.com>
注意到沒,信件的 Subject 有正確編碼成 utf-8 ,而 From 沒有編碼。
大概的解決方式應該只要將 From 重新編碼成 MIME 格式應該就可以了。
~~~~~~
Open file: Subs-Post.php
Search:
// Construct the mail headers...
Add before:
// MIME encode the from(forum_name) - this is tricksy.
for ($i = 0; $i < strlen($context['forum_name']); $i++)
if (ord($context['forum_name']{$i}) > 128 || $context['forum_name']{$i} == '=' || $context['forum_name']{$i} == '?' || $context['forum_name']{$i} == '_')
{
// Add on to the string whenever we find a special character.
$context['forum_name']= substr($context['forum_name'], 0, $i) . '=' . strtoupper(dechex(ord($context['forum_name']{$i}))) . substr($context['forum_name'], $i + 1);
$i18n_char = true;
}
// We don't need to mess with the from line if no special characters were in it..
if (!empty($i18n_char))
$context['forum_name'] = '=?' . $txt['lang_character_set'] . '?Q?' . $context['forum_name'] . '?=';
沒測過,我只是照著 subs-post.php 處理 subject 的方式移到處理 context['forum_name'] 而已。 ^^!!
請教目前utf8版郵件亂碼處理方式依照這個不會有啥大問題吧!抱歉我只是想確認一下,因為這問題目前還沒開放註冊。