I wonder if anyone has a solution? I wanted to use the web browser
control as a 'zoom' box for a smaller textbox. I can format in the
control, and save whatever formatting as HTML code back to the textbox
when the web browser is closed. The only problem comes in the use of
numeric entities to specify Unicode. The web browser control is fine
when it comes to named entities, like . And there are a lot of
named entities, just insufficient for the purpose here (which is a
Greek set of composited Unicode taking up an entire page). But give it
a numeric entity, and it immediately converts to the actual character
which cannot then be read back to the textbox (which is limited to
ASCII), except as a question mark, "?". The Unicode character is lost.
All you have is an ASCII question mark as placeholder.
I couldn't see that setting the enable_utf8 flag would help, nor
another for 'reparsing' or something. These are probably default
anyway. But please, someone correct me if that's wrong.
The best I could come up with is an on-the-fly replacement where the
numeric entity, which displays as it should in the browser control,
but yet forever lost to any attempt to read back the innerHTML
property, is copied to a dummy element of the same number but without
the leading "&#" and trailing semi-colon. So where ΐ would
disappear into a "?", when the web browser control is first opened, it
is copied just immediately before that into a "<x390 />" element. Then
when comes time to finally save the result and close the web browser
control, the "<x390 />" is removed/transformed back into ΐ , in
both cases by VB code, using Regexp, whatever. Obviously, aside from
being kludgey, the method only works when the Unicode is first
enterred into the textbox before opening the web browser control. The
Unicode cannot be directly enterred into the browser control, as might
seem more convenient (cut n paste) from some character map app, for
example.
Hope there's a simpler way. Anyone know?