package com.hs.mail.imap.message;

import org.apache.james.mime4j.codec.DecodeMonitor;
import org.apache.james.mime4j.codec.DecoderUtil;
import org.junit.Test;

public class DecodeTest {

	@Test
	public void testMain() {
		String[] strings = {
				"=?EUC-KR?Q?=BF=AC(HB)20110805-003[hedwig]_SMTP=C1=D7=B4=C2=B9=AE=C1=A6?=",
				"=?utf-8?B?UmU6Tm8gU3ViamVjdA==?=",
				"=?EUC-KR?Q?=BF=AC(HB)20110916-003_[hed?= wig]  ǻ óȲ  繮",
				"=?EUC-KR?Q?=BF=AC(HB)20110922-002_Failed_to_l?= oad IMAP envelope   Դϴ.",
				"JS1(HB)20120308-003 [ȸ =?EUC-KR?Q?=C0=C7]_3/8_=B8=DE=C0=CF=BC=BA=B4=C9?=    - ȸǷ",
				"[IRIS] [01]_ =?UTF-8?Q?=EC=9B=90=EC=8B=A4_>_PO=5F2013.12.13?=",
				"[ZEUS] Commented: (SGBOARD-4588) 15 =?UTF-8?Q?=EB=85=84_=ED=95=98=EB=B0=98?= =?UTF-8?Q?=EA=B8=B0_=EC=A0=95=EB=B3=B4=EC=9D=B8?= =?UTF-8?Q?=ED=94=84=EB=9D=BC_=EB=8F=84=EC=9E=85_=EC=82=AC=EC=97=85_?= =?UTF-8?Q?=EC=9A=94=EA=B5=AC=EC=82=AC=ED=95=AD?=    η غ û"};
		for (String encoded : strings) {
			String decoded = DecoderUtil.decodeEncodedWords(encoded, DecodeMonitor.SILENT);
			System.out.println(decoded);
		}
	}

}

@@ -425,16 +425,25 @@
 ig%5D 
- %C7%BB %C3%B3%C8%B2  %E7%B9%AE
+%EA%B8%B0 %EB%AC%B8%EC%9D%98%EC%82%AC%ED%95%AD %EC%B2%98%EB%A6%AC%ED%98%84%ED%99%A9 %EB%B0%8F %EC%9E%AC%EB%AC%B8%EC%9D%98
 %22,%0D%0A
@@ -517,12 +517,18 @@
 ope 
-  %D4%B4%CF%B4
+%EC%97%90 %EB%8C%80%ED%95%9C %EB%AC%B8%EC%9D%98%EC%9E%85%EB%8B%88%EB%8B%A4
 .%22,%0D
@@ -554,17 +554,17 @@
 08-003 %5B
-%C8%B8
+%ED%9A%8C
  =?EUC-K
@@ -611,14 +611,18 @@
 ?=  
-  - %C8%B8%C7%B7
+%EB%AC%B8%EC%A0%9C %EB%93%B1 - %ED%9A%8C%EC%9D%98%EB%A1%9D
 %22,%0D%0A
@@ -637,17 +637,23 @@
 IS%5D %5B01%5D
-_
+%EC%97%B0%EA%B5%AC%EC%86%8C_%EC%82%AC%EC%97%85%EC%A7%80
  =?UTF-8
@@ -953,15 +953,21 @@
 ?=  
-  %CE%B7 %D8%BA %C3%BB
+%EA%B2%80%ED%86%A0 %EB%B0%8F %EC%9D%B8%EB%A0%A5 %EC%A4%80%EB%B9%84 %EC%9A%94%EC%B2%AD
 %22%7D;%0D

change encoding to utf-8