fputs(tmp, stdout);
fputs(NS_LossyConvertUCS2toASCII(tmp).get(), stdout);
nsContentDLF::CreateDocument(const char* aCommand,                            nsIChannel* aChannel,                            nsILoadGroup* aLoadGroup,                            nsISupports* aContainer,                            const nsCID& aDocumentCID,                            nsIStreamListener** aDocListener,                            nsIContentViewer** aDocViewer){  nsresult rv = NS_ERROR_FAILURE;  nsCOMPtr<nsIURI> aURL;  rv = aChannel->GetURI(getter_AddRefs(aURL));  if (NS_FAILED(rv)) return rv;#ifdef NOISY_CREATE_DOC  if (nsnull != aURL) {    nsAutoString tmp;    aURL->ToString(tmp);    fputs(tmp, stdout);    printf(": creating document\n");  }#endif  nsCOMPtr<nsIDocument> doc;  nsCOMPtr<nsIDocumentViewer> docv;  do {    // Create the document    rv = nsComponentManager::CreateInstance(aDocumentCID, nsnull,                                            NS_GET_IID(nsIDocument),                                            getter_AddRefs(doc));    if (NS_FAILED(rv))      break;    // Create the document viewer  XXX: could reuse document viewer here!    rv = NS_NewDocumentViewer(getter_AddRefs(docv));    if (NS_FAILED(rv))      break;    docv->SetUAStyleSheet(nsContentDLF::GetUAStyleSheet());    // Initialize the document to begin loading the data.  An    // nsIStreamListener connected to the parser is returned in    // aDocListener.    rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener, PR_TRUE);    if (NS_FAILED(rv))      break;    // Bind the document to the Content Viewer    rv = docv->BindToDocument(doc, aCommand);    *aDocViewer = docv;    NS_IF_ADDREF(*aDocViewer);  } while (PR_FALSE);  return rv;}