PRUnichar *prefValue; res = prefs->GetLocalizedUnicharPref("mailnews.send_default_charset", &prefValue);  if (NS_SUCCEEDED(res)) {  retVal = NS_ConvertUCS2toUTF8(prefValue).ToNewCString(); nsMemory::Free(prefValue); } else retVal = nsCRT::strdup("ISO-8859-1");
nsXPIDLString prefValue; res = prefs->GetLocalizedUnicharPref("mailnews.send_default_charset", getter_Copies(prefValue));  if (NS_SUCCEEDED(res)) {  retVal = ToNewUTF8String(prefValue); } else retVal = nsCRT::strdup("ISO-8859-1");
char * nsMsgI18NGetDefaultMailCharset(){  nsresult res = NS_OK;  char * retVal = nsnull;  nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res));   if (nsnull != prefs && NS_SUCCEEDED(res))  {      PRUnichar *prefValue;	  res = prefs->GetLocalizedUnicharPref("mailnews.send_default_charset", &prefValue);	  	  if (NS_SUCCEEDED(res)) 	  {  		//TODO: map to mail charset (e.g. Shift_JIS -> ISO-2022-JP) bug#3941.  		 retVal = NS_ConvertUCS2toUTF8(prefValue).ToNewCString();                 nsMemory::Free(prefValue);	  }	  else 		  retVal = nsCRT::strdup("ISO-8859-1");  }  return (nsnull != retVal) ? retVal : nsCRT::strdup("ISO-8859-1");}