commit | cce9300eefd3be249a8058caa19cf794c7f325d7 | [log] [tgz] |
---|---|---|
author | Sebastian Bazley <sebb@apache.org> | Tue Mar 19 00:13:55 2013 +0000 |
committer | Sebastian Bazley <sebb@apache.org> | Tue Mar 19 00:13:55 2013 +0000 |
tree | 90e85d143cc0c11bd129a140f11f3ee03c534110 | |
parent | 226be7ac79723eefe11fce04d1035a97de0f150b [diff] |
Add whitespace B64 test git-svn-id: https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk@1458069 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java b/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java index de01212..d84c2e7 100644 --- a/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java +++ b/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java
@@ -52,6 +52,12 @@ "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\"\r\n"); } + @Test + public void decodeIso88591Base64EncodedWithWhiteSpace() throws Exception { + assertEncoded("If you can read this you understand the example.", + "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\t \r\n =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\"\r\n"); + } + private static void assertEncoded(String expected, String encoded) throws Exception { assertEquals(expected, MimeUtility.decodeText(encoded)); }