nsresult rv;  nsCOMPtr<nsISupportsWString> theString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { theString->SetData(value); rv = mDefaultBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsWString), theString); } return rv;
if (NS_FAILED(SecurePrefCheck(pref))) return NS_ERROR_FAILURE; return SetDefaultCharPref(pref, NS_ConvertUCS2toUTF8(value).get());
NS_IMETHODIMP nsPref::SetDefaultUnicharPref(const char *pref, const PRUnichar *value){  nsresult rv;  nsCOMPtr<nsISupportsWString> theString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv);  if (NS_SUCCEEDED(rv)) {    theString->SetData(value);    rv = mDefaultBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsWString), theString);  }  return rv;}