SetDisplayCharset(NS_LITERAL_STRING("UTF-8").get());  char* unescapedUrl = PL_strdup(url); if (unescapedUrl) {   nsUnescape(unescapedUrl);  nsCOMPtr <nsIMsgMessageService> messageService; nsresult rv = GetMessageServiceFromURI(url, getter_AddRefs(messageService));  if (NS_SUCCEEDED(rv) && messageService) { nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mDocShell)); messageService->DisplayMessage(url, webShell, mMsgWindow, nsnull, nsnull, nsnull); mLastDisplayURI = url; }  else { nsAutoString urlStr; urlStr.AssignWithConversion(unescapedUrl); nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell)); if(webNav) webNav->LoadURI(urlStr.get(), nsIWebNavigation::LOAD_FLAGS_NONE); } PL_strfree(unescapedUrl); } else { return NS_ERROR_OUT_OF_MEMORY; } } return NS_OK;
char* unescapedUrl = PL_strdup(url); if (unescapedUrl) { nsUnescape(unescapedUrl);  nsIMsgMessageService * messageService = nsnull; nsresult rv = GetMessageServiceFromURI(unescapedUrl, &messageService);  if (NS_SUCCEEDED(rv) && messageService) { messageService->DisplayMessage(unescapedUrl, mWebShell, nsnull, nsnull); ReleaseMessageServiceFromURI(unescapedUrl, messageService); }  else { nsString urlStr(unescapedUrl); if (mWebShell) { mWebShell->LoadURL(urlStr.GetUnicode()); } } PL_strfree(unescapedUrl); } else { return NS_ERROR_OUT_OF_MEMORY; } } return NS_OK;
nsMessenger::OpenURL(const char * url){  if (url)  {#ifdef DEBUG_MESSENGER    printf("nsMessenger::OpenURL(%s)\n",url);#endif        // This is to setup the display DocShell as UTF-8 capable...    SetDisplayCharset(NS_LITERAL_STRING("UTF-8").get());        char* unescapedUrl = PL_strdup(url);    if (unescapedUrl)    {	  // I don't know why we're unescaping this url - I'll leave it unescaped	  // for the web shell, but the message service doesn't need it unescaped.      nsUnescape(unescapedUrl);            nsCOMPtr <nsIMsgMessageService> messageService;      nsresult rv = GetMessageServiceFromURI(url, getter_AddRefs(messageService));            if (NS_SUCCEEDED(rv) && messageService)      {        nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mDocShell));        messageService->DisplayMessage(url, webShell, mMsgWindow, nsnull, nsnull, nsnull);        mLastDisplayURI = url; // remember the last uri we displayed....      }      //If it's not something we know about, then just load the url.      else      {        nsAutoString urlStr; urlStr.AssignWithConversion(unescapedUrl);        nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));        if(webNav)          webNav->LoadURI(urlStr.get(), nsIWebNavigation::LOAD_FLAGS_NONE);      }      PL_strfree(unescapedUrl);    }    else    {      return NS_ERROR_OUT_OF_MEMORY;    }  }  return NS_OK;}