您的位置:首页 > 其它

perl发送邮件中文乱码解决

2014-04-29 13:41 926 查看
环境:

suse linux enterprise server 11

perl 5.10

我是在linux写了perl脚本来发邮件,在windows端用outlook或者foxmail来接收邮件

$a="一些中文字符串";

$b=decode("utf8",$a);

$c=encode("gb2312",$b);



$smtp->datasend("$c\n");

decode:

to convert utf8 data to a string in Perl's internal format

encode:

to convert a string from Perl's internal format to gb2312
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: