Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #12113
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: Textstream Write |
| Date | 2019-04-30 17:06 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <qaadfo$t2d$1@dont-email.me> (permalink) |
| References | <qa6scj$rb4$1@dont-email.me> <qa9gfo$1qi$1@dont-email.me> <qa9snk$1rhs$1@gioia.aioe.org> <qa9v5s$vuj$1@dont-email.me> <qaa856$1hhs$1@gioia.aioe.org> |
"R.Wieser" <address@not.available> wrote
| :-) But thats the problem: You have /way/ more than 256 possible values in
| that string. You're using VBScript, in it internally stores its text in
| widechars (two bytes a piece), meaning you've got not (just) 256, but
65536
| values on your hands.
|
That's not relevant. It's only internal. A normal string
is single byte 1-255, wehther it's ANSI or UTF-8. The UTF-8
is just interpreted differently.
| > When I try to use Asc or AscW or AscB to see what
| > IE thinks is there, they all fail.
|
| Thats odd. Could you show the code you're using to display the Asc
values
| of your webpage string ? And could you retry with a fully ASCII string
| (just to see if its the code or the string thats causing the problems) ?
|
I didn't save the code, but basically it was
just a loop:
for i = 1 to len(s)
s2 = s2 & CStr(Asc(Mid(s, i, 1)))
next
It works on a normal string but none of them work
if I have ▼, give it to IE, then ask for it back
again. IE has apparently gone unicode-16 with it.
| Don't forget the under zero ones. You're working with signed ints. (Its
| what bit me in the behind the first time :-) ).
|
Negative numbers for &#? I've never seen it.
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
| And I'm not quite sure I follow. Wasn't the problem with saving to a
| textfile ?
|
Yes, but saving it from IE. As you probably know,
when you ask IE for DOM data you get the IE
version. For instance, if you ask for the innerHTML
of a SPAN where you used B and /B you might get
back <STRONG> </STRONG>. IE apparently converts
the HTML to its own object hierarchy when it's loaded
into the DOM.
So the problem here is that a webpage with something
like ▼ seems to be getting the string converted,
part or all, to unicode. But I can't see what it's doing
because all attempts to look at the bytes fail.
I load a webpage, get the BODY content, put that
into a DIV in the HTA webpage into an HTA, edit as
desired, then ask IE for the innerHTML of the DIV in
the HTA where I put the BODY content. I then add back
the header and end and write it all to disk. That one 9660
seems to infect the whole thing. If I change it to  
for a non-breaking space, it loads and saves just fine.
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-04-29 08:55 -0400
Re: Textstream Write JJ <jj4public@vfemail.net> - 2019-04-30 17:45 +0700
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-04-30 13:21 +0200
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-04-30 08:51 -0400
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-04-30 18:22 +0200
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-04-30 13:01 -0400
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-04-30 21:37 +0200
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-04-30 17:06 -0400
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-05-01 10:01 +0200
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-05-01 08:37 -0400
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-05-01 16:00 +0200
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-05-01 16:12 +0200
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-05-01 10:47 -0400
Re: Textstream Write "R.Wieser" <address@not.available> - 2019-05-01 19:09 +0200
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-05-04 15:26 -0400
Re: Textstream Write JJ <jj4public@vfemail.net> - 2019-05-05 20:15 +0700
Re: Textstream Write "Mayayana" <mayayana@invalid.nospam> - 2019-05-05 10:19 -0400
csiph-web