From e6c576a629a40cb581390001cec2842f231308d3 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 3 Sep 2012 14:01:30 -0700 Subject: [PATCH] Decode base64 message text * Who the f*** sends text in base64. Oh, that's right - we do. Bug: 7074378 Change-Id: Ic20c6e2aba0b700cbb2cd032f5e541c9a9f83239 --- src/com/android/email/imap2/Imap2SyncService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/imap2/Imap2SyncService.java b/src/com/android/email/imap2/Imap2SyncService.java index 858ef2c0c..acad7a789 100644 --- a/src/com/android/email/imap2/Imap2SyncService.java +++ b/src/com/android/email/imap2/Imap2SyncService.java @@ -26,8 +26,8 @@ import android.database.Cursor; import android.net.TrafficStats; import android.net.Uri; import android.os.Bundle; -import android.os.Debug; import android.os.RemoteException; +import android.util.Base64; import android.util.Log; import com.android.email.imap2.smtp.SmtpSender; @@ -915,6 +915,7 @@ public class Imap2SyncService extends AbstractSyncService { //String charset = getCharset(thisLoc); boolean qp = att.mEncoding.equalsIgnoreCase("quoted-printable"); + boolean b64 = att.mEncoding.equalsIgnoreCase("base64"); int br = res.indexOf('{'); if (br > 0) { @@ -931,6 +932,9 @@ public class Imap2SyncService extends AbstractSyncService { if (qp) { length = QuotedPrintable.decode(buf, length); + } else if (b64) { + buf = Base64.decode(buf, Base64.DEFAULT); + length = buf.length; } if (lastPart) {