hi, all
Now, I'm make a Xpcom-glue program, I want to use a nsDocumentEncoder to dump
the DOM content.
nsCOMPtr<nsIDocumentEncoder> encoder =
do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "text/plain", &rv);
if (NS_FAILED(rv))
return rv;
...
nsCString charset;
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDocument);
NS_ASSERTION(doc, "Need a document");
nsCString charset= doc->GetDocumentCharacterSet();
rv = encoder->SetCharset(charset);
if (NS_FAILED(rv))
return rv;
but when I try to get the charset of the document <aDocument>, I got a SEGV
coredump.
I know this problem is because the internal & external String Problem.
It seems GetDocumentCharacterSet will return an nsCString_internal, and my
program
is XPCOM_GLUE, so charset is nsCString_external, so there is a corefile.
My Question is: is there any way to obtain the charset?
and how to properly handle the Internal & External String API?
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding