res = aCharset->ToString(item->mTitle); if (NS_FAILED(res)) goto done;
item->mTitle.AssignWithConversion(aCharset.get());
nsresult nsCharsetMenu::AddCharsetToItemArray(                        nsICharsetConverterManager2 * aCCMan,                         nsVoidArray * aArray,                         nsIAtom * aCharset,                         nsMenuEntry ** aResult,                        PRInt32 aPlace) {  nsresult res = NS_OK;  nsMenuEntry * item = NULL;   if (aResult != NULL) *aResult = NULL;    item = new nsMenuEntry();  if (item == NULL) {    res = NS_ERROR_OUT_OF_MEMORY;    goto done;  }  item->mCharset = aCharset;  res = aCCMan->GetCharsetTitle2(aCharset, &item->mTitle);  if (NS_FAILED(res)) {    res = aCharset->ToString(item->mTitle);    if (NS_FAILED(res)) goto done;  }  if (aArray != NULL) {    if (aPlace < 0) {      res = aArray->AppendElement(item);      if (NS_FAILED(res)) goto done;    } else {      res = aArray->InsertElementAt(item, aPlace);      if (NS_FAILED(res)) goto done;    }  }  if (aResult != NULL) *aResult = item;  // if we have made another reference to "item", do not delete it   if ((aArray != NULL) || (aResult != NULL)) item = NULL; done:  if (item != NULL) delete item;  return res;}