There's a document I'm displaying in a web browser ActiveX control hosted in a C++ app. This document has a META tag that specifies incorrect charset, so the output is funny. I know the correct encoding and want to change it programmatically to fix that. But whatever I try, the encoding remains unchanged.
I alredy tried, in various combinations and flavors:
IHTMLDocument2::put_Charset
(after the document finished loading);- changing the "charset" property of the "META" tag (using
IHTMLMetaElement
); - deleting the "META" tag altogether (by setting its "outerHTML" to empty string);
- refreshing the control.
The control demonstrates remarkable persistence in preserving the incorrect encoding. What are my other options? I can't manipulate the source of the document being loaded.
According to this, it should work if you call
IWebBrowser->Refresh()
after callingIHTMLDocument2->put_charset()
.