Bug 1489949 - Port bug 1488659: Temporarily remove code using StringProbDetector. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Mon, 10 Sep 2018 19:42:13 +0200
changeset 33118 2275b3b53ada2a4835d57caf207c656b4011bdbb
parent 33117 cacb2b5c2373484ecbf434c126e55750c8b2d993
child 33119 9588a123fb8d0d2f494828240dbc02fc8c75b1da
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersbustage-fix
bugs1489949, 1488659
Bug 1489949 - Port bug 1488659: Temporarily remove code using StringProbDetector. rs=bustage-fix
mailnews/mime/src/comi18n.cpp
--- a/mailnews/mime/src/comi18n.cpp
+++ b/mailnews/mime/src/comi18n.cpp
@@ -33,16 +33,23 @@ void MIME_DecodeMimeHeader(const char *h
                                         eatContinuations, result);
 }
 
 // UTF-8 utility functions.
 //detect charset soly based on aBuf. return in aCharset
 nsresult
 MIME_detect_charset(const char *aBuf, int32_t aLength, const char** aCharset)
 {
+#if 1
+  return NS_ERROR_UNEXPECTED;
+#else
+  // Temporarily removed due to removal of XPCOM interface
+  // NS_STRCDETECTOR_CONTRACTID_BASE "@mozilla.org/intl/stringcharsetdetect;1?type=" along with classes
+  // nsJAStringPSMDetector, nsRUStringProbDetector, nsUKStringProbDetector
+  // in bug 1488659.
   nsresult res = NS_ERROR_UNEXPECTED;
   nsString detector_name;
   *aCharset = nullptr;
 
   NS_GetLocalizedUnicharPreferenceWithDefault(nullptr, "intl.charset.detector", EmptyString(), detector_name);
 
   if (!detector_name.IsEmpty()) {
     nsAutoCString detector_contractid;
@@ -53,13 +60,14 @@ MIME_detect_charset(const char *aBuf, in
       nsDetectionConfident oConfident;
       res = detector->DoIt(aBuf, aLength, aCharset, oConfident);
       if (NS_SUCCEEDED(res) && (eBestAnswer == oConfident || eSureAnswer == oConfident)) {
         return NS_OK;
       }
     }
   }
   return res;
+#endif
 }
 
 } /* end of extern "C" */
 // END PUBLIC INTERFACE