Some more decoder tests - see #2499
This commit is contained in:
parent
deaa7ce291
commit
8b1cfb0730
1 changed files with 14 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue