代码改变世界

SCMBUG 邮件乱码的解决方法

2010-05-04 21:29  atempcode  阅读(453)  评论(0编辑  收藏  举报

1. SVNLOOK 的输出不是UTF8, 而是cmd的locale. Linux下可以指定env: http://osdir.com/ml/bug-tracking.scmbug.user/2006-12/msg00072.html. 而在Windows下就要指定一下输入格式了:

…\hooks\lib\scmbug\Scmbug\Glue\Subversion.pm

 # Cygwin has a problem with newlines
binmode( SVNLOOK_INFO, ":crlf" );
+ binmode( SVNLOOK_INFO, ':encoding(big5)');
# First line is the username
$line = <SVNLOOK_INFO>;

2. 指定发出mail的编码.

C:\Program Files\Scmbug\share\scmbug\lib\Scmbug\Daemon\Process.pm:

 %mail->{ 'X-Mailer' } = "Mail::Sendmail version $Mail::Sendmail::VERSION";
+%mail->{'Content-Type'} = 'text/plain; charset="utf-8"';
%mail->{ Subject } = $subject;