Bug 1404657 - encode message subject to UTF-8 in nsMsgUtils.cpp::NS_MsgStripRE. r=jorgk
authorJorg K <jorgk@jorgk.com>
Sat, 30 Sep 2017 16:53:00 +0200
changeset 30455 be57cca86031e6b25598cdc7d05dc50d3f54c319
parent 30454 cb57855b5455242cd123fe4c625d4bd118208a33
child 30456 59c0f6e4825c4db83eb64c4dbd6ed11aee7be98e
push id2140
push userclokep@gmail.com
push dateMon, 12 Mar 2018 19:42:51 +0000
treeherdercomm-beta@2d485f0d3723 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1404657
Bug 1404657 - encode message subject to UTF-8 in nsMsgUtils.cpp::NS_MsgStripRE. r=jorgk
mailnews/base/util/nsMsgUtils.cpp
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -720,17 +720,17 @@ bool NS_MsgStripRE(const char **stringP,
         const char *p2 = strchr(p1, '?');   // then search for '?'
         if (p2)
         {
           char charset[nsIMimeConverter::MAX_CHARSET_NAME_LENGTH] = "";
           if (nsIMimeConverter::MAX_CHARSET_NAME_LENGTH >= (p2 - p1))
             strncpy(charset, p1, p2 - p1);
           nsAutoCString encodedString;
           rv = mimeConverter->EncodeMimePartIIStr_UTF8(nsDependentCString(s),
-            false, charset, sizeof("Subject:"),
+            false, "UTF-8", sizeof("Subject:"),
             nsIMimeConverter::MIME_ENCODED_WORD_SIZE, encodedString);
           if (NS_SUCCEEDED(rv))
           {
             *modifiedSubject = PL_strdup(encodedString.get());
             return result;
           }
         }
       }