You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2013/03/18 17:31:09 UTC
svn commit: r1457847 -
/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
Author: simonetripodi
Date: Mon Mar 18 16:31:08 2013
New Revision: 1457847
URL: http://svn.apache.org/r1457847
Log:
[FILEUPLOAD-232] added ISO-8859-1?B encoded test, renamed UTF-8 encoded test methods
Modified:
commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java?rev=1457847&r1=1457846&r2=1457847&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (original)
+++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Mon Mar 18 16:31:08 2013
@@ -35,15 +35,21 @@ public final class MimeUtilityTestCase {
}
@Test
- public void decodeQEncoded() throws Exception {
+ public void decodeUtf8QEncoded() throws Exception {
assertEncoded(" hé! àèôu !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=");
}
@Test
- public void decodeBEncoded() throws Exception {
+ public void decodeUtf8BEncoded() throws Exception {
assertEncoded(" hé! àèôu !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=");
}
+ @Test
+ public void decodeIso88591BEncoded() throws Exception {
+ assertEncoded("If you can read this you understand the example.",
+ "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\"\r\n");
+ }
+
private static void assertEncoded(String expected, String encoded) throws Exception {
assertEquals(expected, MimeUtility.decodeText(encoded));
}