Fix for 8405. Japanese shows up in thread pane sender column. r=nhotta, waterson.

This commit is contained in:
putterman%netscape.com 2000-02-02 01:46:24 +00:00
Родитель 8f99495254
Коммит e3af0aa031
2 изменённых файлов: 23 добавлений и 5 удалений

Просмотреть файл

@ -41,6 +41,7 @@
#include "nsIMessageView.h"
#include "nsMsgUtils.h"
#include "nsMessageViewDataSource.h"
#include "nsTextFormatter.h"
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
@ -301,13 +302,28 @@ nsresult nsMsgMessageDataSource::GetSenderName(nsAutoString& sender, nsAutoStrin
nsresult rv = NS_OK;
if(mHeaderParser)
{
char *name;
if(NS_SUCCEEDED(rv = mHeaderParser->ExtractHeaderAddressName (nsnull, nsAutoCString(sender), &name)))
{
*senderUserName = name;
char *senderUTF8 = sender.ToNewUTF8String();
if(!senderUTF8)
return NS_ERROR_FAILURE;
if(NS_SUCCEEDED(rv = mHeaderParser->ExtractHeaderAddressName("UTF-8", senderUTF8, &name)))
{
if(name)
{
PRUnichar *newSender;
nsAutoString fmt("%s");
newSender = nsTextFormatter::smprintf(fmt.GetUnicode(),name);
if(newSender)
{
senderUserName->SetString(newSender);
nsTextFormatter::smprintf_free(newSender);
}
nsCRT::free(name);
}
Recycle(senderUTF8);
}
if(name)
PL_strfree(name);
}
return rv;
}

Просмотреть файл

@ -79,6 +79,8 @@ TestSegmentedBuffer();
void XXXNeverCalled()
{
nsTextFormatter::snprintf(nsnull,0,nsnull);
nsTextFormatter::smprintf(nsnull, nsnull);
nsTextFormatter::smprintf_free(nsnull);
dummyComparitor dummy;
nsVoidArray();
nsAVLTree(dummy, nsnull);