inString.Assign(NS_LITERAL_STRING("\xA0\xA1\xA2\xA3"));
inString.Assign(NS_ConvertASCIItoUCS2("\xA0\xA1\xA2\xA3"));
static void TestEntityConversion(PRUint32 version){  cout << "==============================\n";  cout << "Start nsIEntityConverter Test \n";  cout << "==============================\n";  PRUint32 i;  nsString inString;  PRUnichar uChar;  nsresult res;  inString.Assign(NS_LITERAL_STRING("\xA0\xA1\xA2\xA3"));  uChar = (PRUnichar) 8364; //euro  inString.Append(&uChar, 1);  uChar = (PRUnichar) 9830; //  inString.Append(&uChar, 1);  nsCOMPtr <nsIEntityConverter> entityConv;  res = nsComponentManager::CreateInstance(kEntityConverterCID, NULL, NS_GET_IID(nsIEntityConverter), getter_AddRefs(entityConv));  if (NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n"; return;}  // convert char by char  for (i = 0; i < inString.Length(); i++) {    char *entity = NULL;    res = entityConv->ConvertToEntity(inString[i], version, &entity);    if (NS_SUCCEEDED(res) && NULL != entity) {      cout << inString[i] << " " << entity << "\n";      nsMemory::Free(entity);    }  }  // convert at once as a string  PRUnichar *entities;  res = entityConv->ConvertToEntities(inString.get(), version, &entities);  if (NS_SUCCEEDED(res) && NULL != entities) {    for (i = 0; i < nsCRT::strlen(entities); i++) {      cout << (char) entities[i];      if (';' == (char) entities[i])        cout << "\n";    }    nsMemory::Free(entities);  }  cout << "==============================\n";  cout << "Finish nsIEntityConverter Test \n";  cout << "==============================\n\n";}