res = GetCharsetAtom(fullName.GetUnicode(), getter_AddRefs(atom));
res = GetCharsetAtom(fullName.get(), getter_AddRefs(atom));
nsresult nsCharsetConverterManager::GetRegistryEnumeration(                                    char * aRegistryKey,                                    char * aAddPrefix,                                    nsISupportsArray ** aArray){  nsresult res = NS_OK;  nsCOMPtr<nsISupportsArray> array = NULL;  nsRegistryKey key;  res = nsComponentManager::CreateInstance(kSupportsArrayCID, NULL,       NS_GET_IID(nsISupportsArray), getter_AddRefs(array));  if (NS_FAILED(res)) return res;  // get the registry  NS_WITH_SERVICE(nsIRegistry, registry, kRegistryCID, &res);  if (NS_FAILED(res)) return res;  // open registry if necessary  PRBool regOpen = PR_FALSE;  registry->IsOpen(&regOpen);  if (!regOpen) {    res = registry->OpenWellKnownRegistry(nsIRegistry::ApplicationComponentRegistry);    if (NS_FAILED(res)) return res;  }  // get subtree  res = registry->GetSubtree(nsIRegistry::Common, aRegistryKey, &key);  if (NS_FAILED(res)) return res;  // enumerate subtrees  nsCOMPtr<nsIEnumerator> enumerator;  res = registry->EnumerateSubtrees(key, getter_AddRefs(enumerator));  if (NS_FAILED(res)) return res;  nsCOMPtr<nsIRegistryEnumerator> components = do_QueryInterface(enumerator, &res);  if (NS_FAILED(res)) return res;  res = components->First();  if (NS_FAILED(res)) return res;  while (NS_OK != components->IsDone()) {    const char *name;    nsAutoString fullName; fullName.AssignWithConversion(aAddPrefix);    nsCOMPtr<nsIAtom> atom;    res = components->CurrentItemInPlaceUTF8(&key, &name);    if (NS_FAILED(res)) goto next;    fullName.AppendWithConversion(name);    res = GetCharsetAtom(fullName.GetUnicode(), getter_AddRefs(atom));    if (NS_FAILED(res)) goto next;    res = array->AppendElement(atom);    if (NS_FAILED(res)) goto next;next:    res = components->Next();    if (NS_FAILED(res)) break; // this is NOT supposed to fail!  }  // everything was fine, set the result  *aArray = array;  NS_ADDREF(*aArray);  return res;}