Bug 1324443 - Always use UTF-8 for encoding attachment filenames. r=aceman a=jorgk
authorJorg K <jorgk@jorgk.com>
Mon, 19 Dec 2016 09:08:00 +0100
changeset 27689 3747ae2ff8d3f25fab0528217aefbbe43764f892
parent 27688 b970baae33f89fd32eb9a6cd807fd9a7c2d1c9cf
child 27690 ecce0f2803565cc523c8971ca5e95522f9ec4753
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, jorgk
bugs1324443
Bug 1324443 - Always use UTF-8 for encoding attachment filenames. r=aceman a=jorgk
mailnews/compose/src/nsMsgCompUtils.cpp
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -717,17 +717,19 @@ mime_generate_attachment_headers (const 
     buf.Append("\"");
   }
 
 #ifdef EMIT_NAME_IN_CONTENT_TYPE
   if (encodedRealName && *encodedRealName) {
     // Note that we don't need to output the name field if the name encoding is
     // RFC 2231. If the MUA knows the RFC 2231, it should know the RFC 2183 too.
     if (parmFolding != 2) {
-      char *nameValue = LegacyParmFolding(charset, nsDependentCString(real_name),
+      // The underlying JS MIME code will only handle UTF-8 here.
+      char *nameValue = LegacyParmFolding(NS_LITERAL_CSTRING("UTF-8"),
+                                          nsDependentCString(real_name),
                                           parmFolding);
       if (!nameValue || !*nameValue) {
         PR_FREEIF(nameValue);
         nameValue = encodedRealName;
       }
       buf.Append(";\r\n name=\"");
       buf.Append(nameValue);
       buf.Append("\"");