char *tempCstr = tempStr.ToNewCString();
char *tempCstr = ToNewCString(tempStr);
int main(int argc, char** argv) {  nsresult rv;  NS_SetupRegistry();  nsCOMPtr <nsII18nCompatibility> I18nCompatibility;  rv = nsComponentManager::CreateInstance(kI18nCompatibilityCID, NULL,                                           NS_GET_IID(nsII18nCompatibility), getter_AddRefs(I18nCompatibility));  if (NS_SUCCEEDED(rv)) {    PRUint16 csid = 0;    PRUnichar *charsetUni = NULL;    rv = I18nCompatibility->CSIDtoCharsetName(csid, &charsetUni);    if (NS_SUCCEEDED(rv) && NULL != charsetUni) {      nsString tempStr(charsetUni);      char *tempCstr = tempStr.ToNewCString();      nsMemory::Free(charsetUni);      if (NULL != tempCstr) {        cout << csid << " " << tempCstr << "\n";        delete [] tempCstr;      }    }  }  else {    cout << "error: CreateInstance\n";  }  cout << "done\n";  return 0;}