diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 2066eb8d6..855da6102 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -6,12 +6,14 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; +import java.nio.charset.Charset; + + import org.apache.commons.io.IOUtils; import org.apache.james.mime4j.decoder.Base64InputStream; import org.apache.james.mime4j.decoder.DecoderUtil; import org.apache.james.mime4j.decoder.QuotedPrintableInputStream; -import org.apache.james.mime4j.util.CharsetUtil; import android.util.Log; @@ -24,6 +26,8 @@ import com.fsck.k9.mail.Multipart; import com.fsck.k9.mail.Part; public class MimeUtility { + + public static String unfold(String s) { if (s == null) { return null; @@ -129,6 +133,8 @@ public class MimeUtility { * @throws IOException */ public static String getTextFromPart(Part part) { + Charset mCharsetConverter; + try { if (part != null && part.getBody() != null) { InputStream in = part.getBody().getInputStream(); @@ -153,7 +159,8 @@ public class MimeUtility { /* * See if there is conversion from the MIME charset to the Java one. */ - charset = CharsetUtil.toJavaCharset(charset); + mCharsetConverter = Charset.forName(charset); + charset = mCharsetConverter.name(); } if (charset != null) { /*