最近鳥事很多,加上放假都去看車,所以沒有更新Blog。(對,我懶:P) OpenWebMail自從2.53版後UTF-8做得相當好,但是在IE卻會發生中文檔名附件無法下載;用Big5介面則無此問題,但這樣實在太鳥了,尤其是敝公司有幾位員工名字有unicode字元,這樣就不能正常顯示,決定動手去硬改完全不懂的Openwebmail Perl程式碼。 把openwebmail-viewatt.pl改掉,在269列前,加上 } elsif ( $ENV{'HTTP_USER_AGENT'}=~/MSIE/ or $ENV{'HTTP_USER_AGENT'}=~/Chrome/ ) { my $filename_encoded = uri_escape($filename); $attheader.=qq|Content-Disposition: attachment; filename="$filename_encoded"\n|; 最前面也要加上 use URI::Escape; 由於小弟手賤,把所有員工的openwebmailrc都改成utf-8,就不管以上hack在big5是否正常了:P (會變亂碼,但仍然可以下載...) Update :做成patch file,如下: --- openwebmail-viewatt.pl 2009-01-06 16:48:24.000000000 +0800 +++ /usr/local/www/cgi-bin/openwebmail/openwebmail-viewatt.pl 2009-01-06 16:14:24.000000000 +0800 @@ -4,6 +4,8 @@ # use vars qw($SCRIPT_DIR); +use URI::Escape; + if ( $0 =~ m!^(\S*)/[\w\d\-\.]+\.pl! ) { local $1; $SCRIPT_DIR=$1 } if ($SCRIPT_DIR eq '' && open(F, '/etc/openwebmail_path.conf')) { $_= ; close(F); if ( $_=~/^(\S*)/...