森林之原
五月 23, 2012, 11:26:07 pm *
歡迎光臨, 訪客. 請先 登入註冊一個帳號.

請輸入帳號, 密碼以及預計登入時間
新聞: CPG 1.4.3 繁體中文完成,請到 CPG 的版面下載。
 
   首頁   說明 搜尋 日曆 登入 註冊  
頁: 1 [2]   向下
  寄送主題  |  列印  
作者 主題: utf-8 郵件亂碼  (閱讀 16411 次)
0 會員 以及 2 訪客 正在閱讀本篇主題.
monkey
訪客
« 回覆文章 #15 於: 三月 11, 2005, 09:31:04 pm »

不知道有沒有可能改成用html寄信...  smiley01_040
向版主檢舉   已記錄
Andrew::
魔,羯
*
離線 離線

文章: 217



個人網站
« 回覆文章 #16 於: 三月 12, 2005, 01:03:25 am »

管理員可以用html寄信,回覆通知的信不能用html,目前還不能。
向版主檢舉   已記錄

Lin
見習生
**
離線 離線

文章: 94



« 回覆文章 #17 於: 七月 01, 2005, 08:09:43 am »

大概找到原因了!!
底下是收到的郵件內容:
程式碼:
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版郵件亂碼處理方式依照這個不會有啥大問題吧!抱歉我只是想確認一下,因為這問題目前還沒開放註冊。
向版主檢舉   已記錄


Lin的資訊網
專注美女近乎苛求
頁: 1 [2]   向上
  寄送主題  |  列印  
 
前往:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Valid XHTML 1.0! Valid CSS!