PRUnichar *defaultCharset=nsnull; PRUnichar *forceCharset=nsnull;
nsXPIDLString defaultCharset; nsXPIDLString forceCharset;
NS_IMETHODIMP nsWebShell::AddChild(nsIDocShellTreeItem *aChild){   NS_ENSURE_ARG_POINTER(aChild);   NS_ENSURE_SUCCESS(aChild->SetParent(this), NS_ERROR_FAILURE);   mChildren.AppendElement(aChild);   NS_ADDREF(aChild);   nsCOMPtr<nsIDocShell> childAsDocShell(do_QueryInterface(aChild));   if(!childAsDocShell)      return NS_OK;   // Do some docShell Specific stuff.   PRUnichar *defaultCharset=nsnull;   PRUnichar *forceCharset=nsnull;   NS_ENSURE_TRUE(mContentViewer, NS_ERROR_FAILURE);   nsCOMPtr<nsIMarkupDocumentViewer> muDV = do_QueryInterface(mContentViewer);   if(muDV)      {      NS_ENSURE_SUCCESS(muDV->GetDefaultCharacterSet (&defaultCharset), NS_ERROR_FAILURE);      NS_ENSURE_SUCCESS(muDV->GetForceCharacterSet (&forceCharset), NS_ERROR_FAILURE);      }   nsCOMPtr<nsIContentViewer> childCV;   NS_ENSURE_SUCCESS(childAsDocShell->GetContentViewer(getter_AddRefs(childCV)),      NS_ERROR_FAILURE);   if(childCV)      {      nsCOMPtr<nsIMarkupDocumentViewer> childmuDV = do_QueryInterface(childCV);      if(childmuDV)         {         NS_ENSURE_SUCCESS(childmuDV->SetDefaultCharacterSet(defaultCharset),             NS_ERROR_FAILURE);         NS_ENSURE_SUCCESS(childmuDV->SetForceCharacterSet(forceCharset),             NS_ERROR_FAILURE);         }      }  return NS_OK;}