Fix for bug 15201. We need to convert back the result from UTF-8 to Unicode. R=mscott, bienvenu

This commit is contained in:
ducarroz%netscape.com 1999-10-22 20:37:42 +00:00
Родитель dfb0501d5c
Коммит 7957d17185
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -205,9 +205,15 @@ NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(nsISupports *aParam, const P
if (parser)
parser->MakeFullAddress(nsnull, m_searchNameCompletionEntryTable[nIndex].userName,
m_searchNameCompletionEntryTable[nIndex].emailAddress, &fullAddress);
nsString searchResult(fullAddress);
/* We need to convert back the result from UTF-8 to Unicode */
PRUnichar* searchResult;
PRInt32 searchResultLen;
INTL_ConvertToUnicode(fullAddress, nsCRT::strlen(fullAddress), (void**)&searchResult, &searchResultLen);
// iterate over the table looking for a match
rv = aResultListener->OnAutoCompleteResult(aParam, aSearchString, searchResult.GetUnicode());
rv = aResultListener->OnAutoCompleteResult(aParam, aSearchString, searchResult);
PR_Free(searchResult);
break;
}
}