Eating weblog

01 四月, 2009

Openwebmail中文亂碼

資訊科技 — 作者 wkb @ 07:10

近日更新了openwebmail到2.53的版本,但是發現一些中文亂碼的問題,調整方法如下:

1.先將個人設定中的語系改為Chinese/Taiwan(zh_TW),字集改為Big5,(「設定」-> 「字集」選「big5」)

2.改完設定後,有可能會在信件中反而出現[UTF8]的狀況,這個需要修改openwebmail原始程式

修改三個檔案

/var/www/cgi-bin/openwebmail/openwebmail-main.pl

找到 my ($from, $to, $subject)=iconv('utf-8' , ...
加入
$from =~ s/\[UTF-8\?\]//g;
$to =~ s/\[UTF-8\?\]//g;
$subject =~ s/\[UTF-8\?\]//g;

/var/www/cgi-bin/openwebmail/openwebmail-read.pl

找到 ($body) = iconv($convfrom, $readcharset, $body) ...
加入
$from =~ s/\[UTF-8\?\]//g;
$replyto =~ s/\[UTF-8\?\]//g;
$to =~ s/\[UTF-8\?\]//g;
$cc =~ s/\[UTF-8\?\]//g;
$bcc =~ s/\[UTF-8\?\]//g;
$subject =~ s/\[UTF-8\?\]//g;

/var/www/cgi-bin/openwebmail/openwebmail-send.pl

找到 ($h)=iconv('utf-8', $composecharset, $h);
加入
$h =~ s/\[UTF-8\?\]//g;
找到($subject, $to, $cc)=iconv('utf-8',$composecharset,$subject,$to,$cc);
加入
$to =~ s/\[UTF-8\?\]//g;
$cc =~ s/\[UTF-8\?\]//g;
$subject =~ s/\[UTF-8\?\]//g;
找到 ($h, $subject)=iconv('utf-8', $composecharset, $h, $subject);
加入
$h =~ s/\[UTF-8\?\]//g;
$subject =~ s/\[UTF-8\?\]//g;
找到 ($subject, $replyto)=iconv('utf-8',$composecharset,$subject,$replyto);
加入
$subject =~ s/\[UTF-8\?\]//g;
$replyto =~ s/\[UTF-8\?\]//g;
找到 ($subject)=iconv('utf-8', $composecharset, $subject);
加入
$subject =~ s/\[UTF-8\?\]//g;

原始找到的網站!!


迴響

Powered by LifeType