我使用ant生成一个svn日志文件,然后将结果与邮件任务一起发送。我无法设置正确的字符编码。当我使用outlook打开邮件时,重音字符显示不正确。
输出文件是cp850格式的(基于我的cmd shell)
D:\MEP>chcp
Active code page: 850ant任务是
<target name="test">
<exec executable="svn" output="logresult.txt">
<arg line="log -g src" />
</exec>
<mail mailhost="mail.xxxxxx.xx" subject="Test character-encoding"
tolist="sxxxxx@xxxxx.com"
messagefile="logresult.txt">
<from address="ant@xxxxx.com"/>
</mail>
</target>我尝试更改svn日志输出编码...没有成功。
我尝试在邮件任务中设置"charset“属性...没有成功。
有什么i18n技巧吗?
提亚
发布于 2012-12-21 06:21:11
编码对邮件标签无效。
我最终使用"iconv“将输出从cp850转换为iso-88590-1。
发布于 2012-10-26 03:39:11
尝试属性编码,默认设置为auto (参见ant manual mail task):
<mail mailhost="mail.xxxxxx.xx" subject="Test character-encoding"
tolist="sxxxxx@xxxxx.com"
messagefile="logresult.txt"
encoding="plain">
<from address="ant@xxxxx.com"/>
</mail>一些用于重新编码文本文件的新ant任务可能也会派上用场=> Reencode 0.1
https://stackoverflow.com/questions/13075626
复制相似问题