Path: csiph.com!news.uzoreto.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Mayayana" Newsgroups: microsoft.public.scripting.vbscript Subject: Re: Textstream Write Date: Tue, 30 Apr 2019 17:06:09 -0400 Organization: A noiseless patient Spider Lines: 62 Message-ID: References: Injection-Date: Tue, 30 Apr 2019 21:08:08 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="49121b4e885b14f0ec3d330ac7947f38"; logging-data="29773"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rTEahGOSAFMVweX0+gZDfoDWGx2Khb8k=" Cancel-Lock: sha1:DzP6cQUmRLV6z95CFP1AQBZbkNs= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com microsoft.public.scripting.vbscript:12113 "R.Wieser" 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 . 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.