Some more decoder tests - see #2499

This commit is contained in:
Philip Whitehouse 2017-08-30 22:15:40 +01:00 committed by Philip
parent deaa7ce291
commit 8b1cfb0730

View file

@ -109,5 +109,19 @@ public class DecoderUtilTest {
expect = "=?x?= =?";
message = null;
assertEquals(expect, DecoderUtil.decodeEncodedWords(body, message));
//Multi encoded header
body = "=?utf-8?B?5Liq5Lq66YKu566xOkJVRyAjMzAyNDY6OumCruS7tuato+aWh+mZhOS7tuWQ?=\n" +
"=?utf-8?B?jeensOecgeeVpeaYvuekuuS8mOWMlg==?=";
expect = "个人邮箱:BUG #30246::邮件正文附件<E99984><E4BBB6>称省略显示优化";
message = null;
assertEquals(expect, DecoderUtil.decodeEncodedWords(body, message));
//Non utf-8 encoding
body = "=?gb2312?B?Obv9t9az6cnu29rHsLqju6rHyLPHSlfN8rrAvsa16qOsuPzT0DIwvNIzOTnU?= " +
"=?gb2312?B?qr6r0aG439DHytTLr77Gteq1yMTjwLSjoaOoQUSjqQ?=";
expect = "9积分抽深圳前海华侨城JW万豪酒店更有20家399<EFBFBD><EFBFBD>精选高星试睡酒店等你来AD<EFBFBD>";
message = null;
assertEquals(expect, DecoderUtil.decodeEncodedWords(body, message));
}
}