473,320 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Web browser control, Unicode

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 &#x390; , 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?
Nov 13 '05 #1
1 3182
Mark Johnson <10*******@compuserve.com> wrote:
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 &nbsp; . 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.


So for anyone interested, here's the simple regexp patterns for the
substitutions required.

The textbox control is being 'zoomed' in a popup which uses a web
browser control. As soon as any numeric entity gets put into the
browser control, it's lost. It will display properly. But it can't be
then read back out with document.body.innerHTML (or outerHTML). It's
just gone.

So just before the zoom popup is . . popped up, one modifies the text
in the textbox control, itself.

textbox control = fRegexp(textbox control, "&#([^;]*);",
"<A$1/>&#$1;", True)

where fRegexp is some code you place in a module as cover to the WSH
or whatever regexp function.

Public Function fRegExp(ByVal strFull As String, strPattern As String,
strReplace As String, boolGlobal As Boolean)
Dim regexp1 As New regexp

regexp1.Pattern = strPattern
regexp1.Global = boolGlobal
fRegExp = regexp1.replace(strFull, strReplace)

End Function
And when it comes time to close the popup, and save the final result,
the textbox control again is written directly as:

textbox control = fRegexp(textbox control, "<A([^\?]*) />\?", "&#$1;",
True)
But, once again, the problem is that this keeps any Unicode editing
out of the zoom box. And it would seem to me it might be convenient to
cut n paste from some charmap-type app those Unicode values directly
into the zoom, rather than the underlying textbox after the zoom is
closed. I guess the fix, there, would be to add a button to the zoom
box button bar (assuming one uses such a custom bar), to insertHTML
for each Unicode value, with the dummy "<a . . />" elements and all,
so that these too would be included in the closing call to fRegexp.

But - that is - there must be a better way. Ideally, one could simply
turn

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: aa | last post by:
I have an UTF-8 PHP file which generates HTML Then I cut the beginning of that file, pasted into another UTF-8 file ind included this second file into the first one. After that the whole page...
17
by: gokul | last post by:
Hi, Iam a newbie to dotnet and I experience problems in using the Browser control in VB .net. Though Iam able to use it with its basic features, I need to customise it. ...
7
by: Shelly | last post by:
Hi I am developing a web application for multi language support. But when I view in browser, all languages are shown except Japanese. Do I need to follow some conventions or special settings for...
5
by: Nancy | last post by:
I recently completed a web page, "Browser Tests of Entities in 2004". http://www.santagata.us/characters/CharacterEntities.html It shows those characters that work in all of the version 5.2+...
0
by: Mark Johnson | last post by:
The last reply got sort of cutoff. So here again: So for anyone interested, here's the simple regexp patterns for the substitutions required. The textbox control is being 'zoomed' in a popup...
16
by: Alex Clark | last post by:
Hi All, I'm sure this must have been asked a million times due to it's usefulness, but are there any sensible solutions for disabling right click (and other services such as Ctrl+P, Browser...
2
by: Mick_fae_Glesga | last post by:
Hello everyone! OK, I'm writing a windows program that requires the user to enter Cyrillic characters into an Edit control. But, I can't seem to get the Cyrillic characters to appear in the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.