Bug 319037 - Provide default value for mailnews.localizedRe, patch to fix backend, r+sr=bienvenu
authorDan Mosedale <dmose@mozilla.org>
Tue, 17 Feb 2009 22:12:44 -0800
changeset 1984 d05b4e440745514d80257b506171663c3f51c967
parent 1983 6236b2be0795fca8ae7201b39600fd6255f33669
child 1985 9a04c76b65f020c5826e8da381059f47e4404639
push idunknown
push userunknown
push dateunknown
bugs319037
Bug 319037 - Provide default value for mailnews.localizedRe, patch to fix backend, r+sr=bienvenu
mailnews/base/util/nsMsgUtils.cpp
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -554,20 +554,22 @@ PRBool NS_MsgStripRE(const char **string
   const char *last;
   PRUint32 L;
   PRBool result = PR_FALSE;
   NS_ASSERTION(stringP, "bad null param");
   if (!stringP) return PR_FALSE;
 
   // get localizedRe pref
   nsresult rv;
-  nsCString localizedRe;
-  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
-  if (NS_SUCCEEDED(rv))
-    prefBranch->GetCharPref("mailnews.localizedRe", getter_Copies(localizedRe));
+  nsString utf16LocalizedRe;
+  NS_GetLocalizedUnicharPreferenceWithDefault(nsnull,
+                                              "mailnews.localizedRe",
+                                              EmptyString(),
+                                              utf16LocalizedRe);
+  NS_ConvertUTF16toUTF8 localizedRe(utf16LocalizedRe);
 
   // hardcoded "Re" so that noone can configure Mozilla standards incompatible
   nsCAutoString checkString("Re,RE,re,rE");
   if (!localizedRe.IsEmpty()) {
     checkString.Append(',');
     checkString.Append(localizedRe);
   }