NS_ConvertUTF8toUCS2 uv(nsUnescape(NS_CONST_CAST(char *, cname.get())));
NS_ConvertUTF8toUCS2 uv(nsUnescape(cname.BeginWriting()));
HTMLContentSink::AddAttributes(const nsIParserNode& aNode,                               nsIHTMLContent* aContent, PRBool aNotify,                               PRBool aCheckIfPresent){  // Add tag attributes to the content attributes  PRInt32 ac = aNode.GetAttributeCount();  if (ac == 0) {    // No attributes, nothing to do. Do an early return to avoid    // constructing the nsAutoString object for nothing.    return NS_OK;  }  nsAutoString k;  nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());  // The attributes are on the parser node in the order they came in in the  // source.  What we want to happen if a single attribute is set multiple  // times on an element is that the first time should "win".  That is, <input  // value="foo" value="bar"> should show "foo".  So we loop over the  // attributes backwards; this ensures that the first attribute in the set  // wins.  This does mean that we do some extra work in the case when the same  // attribute is set multiple times, but we save a HasAttr call in the much  // more common case of reasonable HTML.    for (PRInt32 i = ac - 1; i >= 0; i--) {    // Get lower-cased key    const nsAString& key = aNode.GetKeyAt(i);    k.Assign(key);    ToLowerCase(k);    nsCOMPtr<nsIAtom> keyAtom = do_GetAtom(k);    if (aCheckIfPresent && aContent->HasAttr(kNameSpaceID_None, keyAtom)) {      continue;    }    // Get value and remove mandatory quotes    static const char* kWhitespace = "\n\r\t\b";    const nsAString& v =      nsContentUtils::TrimCharsInSet(kWhitespace, aNode.GetValueAt(i));    if (nodeType == eHTMLTag_a && keyAtom == nsHTMLAtoms::name) {      NS_ConvertUCS2toUTF8 cname(v);      NS_ConvertUTF8toUCS2 uv(nsUnescape(NS_CONST_CAST(char *,                                                       cname.get())));      // Add attribute to content      aContent->SetAttr(kNameSpaceID_None, keyAtom, uv, aNotify);    } else {      // Add attribute to content      aContent->SetAttr(kNameSpaceID_None, keyAtom, v, aNotify);    }  }  return NS_OK;}