nsDependentString aTopicString(aTopic); if (aTopicString.Equals(NS_LITERAL_STRING("nsPref:changed")))
if (!nsCRT::strcmp(aTopic, "nsPref:changed"))
NS_IMETHODIMP nsFolderCharsetObserver::Observe(nsISupports *aSubject, const PRUnichar *aTopic, const PRUnichar *someData){  nsresult rv;  nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID, &rv);  NS_ENSURE_SUCCESS(rv, rv);  nsDependentString aTopicString(aTopic);  if (aTopicString.Equals(NS_LITERAL_STRING("nsPref:changed")))  {    nsDependentString prefName(someData);        if (prefName.Equals(NS_LITERAL_STRING(kMAILNEWS_VIEW_DEFAULT_CHARSET)))    {      PRUnichar *prefCharset = nsnull;      rv = prefs->GetLocalizedUnicharPref(kMAILNEWS_VIEW_DEFAULT_CHARSET, &prefCharset);      if (NS_SUCCEEDED(rv))      {        gDefaultCharacterSet.Assign(prefCharset);        PR_Free(prefCharset);      }    }    else if (prefName.Equals(NS_LITERAL_STRING(kMAILNEWS_DEFAULT_CHARSET_OVERRIDE)))    {      rv = prefs->GetBoolPref(kMAILNEWS_DEFAULT_CHARSET_OVERRIDE, &gDefaultCharacterOverride);    }  }  else if (aTopicString.Equals(NS_LITERAL_STRING(NS_XPCOM_SHUTDOWN_OBSERVER_ID)))  {    rv = prefs->RemoveObserver(kMAILNEWS_VIEW_DEFAULT_CHARSET, this);    rv = prefs->RemoveObserver(kMAILNEWS_DEFAULT_CHARSET_OVERRIDE, this);    gReleaseObserver = PR_TRUE;   // set true to release observer  }  return rv;}