Problem with encoding using IPersistStreamInit to load HTML



Hi,

I'm using IPersistStreamInit to load a
HTML content into the webcontrol as described
in:

http://msdn.microsoft.com/workshop/browser/webbrowser/tutorials/webocstream.
asp

My problem is, that the encoding doesn't seem to
work correctly.

See following example HTML:

<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>Test</title>
</head>
<body>
2 ?l.
</body>
</html>

Using IPersistStreamInit to load HTML string to
the webcontrol shows 2 wrong chars instead of ?.
If I load this HTML from file the contents
is shown properly.

If I query charset property from appropriate
IHTMLDocument2, I get "unicode" for loading
HTML from file.
In case loading from stream I get "windows-1252"
and even switching the charset afterwards to
"utf-16" doesn't work.

Does anybody know, how to deal with that?

Thanks & best regards
Michael


.



Relevant Pages

  • Re: Problem with encoding using IPersistStreamInit to load HTML
    ... > I'm using IPersistStreamInit to load a ... > HTML content into the webcontrol as described ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Unhandled exception in MSHTML.DLL
    ... > always crashes when its CHtmlView view started to load a specific local ... > html page, please let me know if I have misunderstood anything. ... > program crashes at. ... All 3 files load just fine in a regular browser. ...
    (microsoft.public.vc.mfc)
  • Re: Lost formatting in browser view source
    ... At the same time your html pages without php-code are processed by php. ... If you are concerned about users links and bookmarks to break, you have the nice option in apache to rewrite rules, if they try to load a "missing" html page, redirect them to a php file with the same name. ... run your editor, load 100 pages, use find/replace to change the address ...
    (alt.php)
  • Re: Poor perfomance with Spreadsheet OWC 10 with more than 200 columns
    ... then i load into the spreadsheet using XMLLOAD. ... HTML portion is what is slowing it down. ... > OWC Version: 10.0.0.2621 ... >>> to design the html table, reading from a Recordset. ...
    (microsoft.public.office.developer.web.components)
  • Re: Another basic question: How to call and show one Web Form from another Web Form?
    ... > I've got an ASP.NET Form (Web Form) that contains various info/controls. ... > ' What do I use to load MyWebForm in the current browser window? ... am I being unrealistic in wanting to NOT keep resorting back to HTML ... I find the HTML syntax mind boggling, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)