Re: Opening a text file that may be ASCII *or* Unicode



Excellent observation! VBS appears to do manage internal strings in
Unicode. I didn't know that.

My question, then, should be rephrased as follows:

1. Can you confirm that opening with TriStateUseDefault will convert
ASCII to Unicode whenever possible?

2. If my strategy will work, *why* does it work? Just how does
TriStateUseDefault work?

Do you agree now, at least, with my questions? ;-)

Thanks for your help.

regards, Andy

"Miyahn" <HQF03250@xxxxxxxxxxx> wrote:

>"Andrew Aronoff" wrote in message news:vd44b1do6aumjtv8ocl1298ppeed4836ne@xxxxxxx
>> >> 1. Can you confirm that opening with TriStateUseDefault will convert the
>> >> Unicode to ASCII whenever possible?
>> >No. Not at all.
>>
>> Except that's what I'm seeing. The Unicode file opened with
>> TriStateUseDefault is comparing perfectly with plain ASCII stored in
>> the script.
>
>I think that 'plain ASCII stored in the script' isn't 'plain ASCII'.
>
>Try this.
>
>strASCII = "abc"
>For I = 1 To LenB(strASCII)
> Buf = Buf & " " & Right("0" & Hex(AscB(MidB(strASCII, I, 1))), 2)
>Next
>MsgBox Mid(Buf, 2)

--
**********

Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com

To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org

**********
.



Relevant Pages

  • Re: Opening a text file that may be ASCII *or* Unicode
    ... The Unicode file opened with ... the script. ... TriStateUseDefault work? ... ASCII) is not known in advance: ...
    (microsoft.public.scripting.vbscript)
  • How to convert strings between ASCII and Unicode?
    ... I have saved all the web pages that display lists of book titles at a web ... Unicode, but the dictionary .Exists method seems to mess up with a mixture ... And my Unicode files are about twice as large as the plain ASCII file. ...
    (microsoft.public.scripting.vbscript)
  • Re: Getting clean ascii output
    ... using bash and awk, I discovered that it appears to have both Unicode ... it with plain ascii. ... paste it into an awk gsub command. ...
    (comp.unix.shell)
  • Re: Re curly quotes and forcing ascci
    ... > curly quotes and a few other rich text chars in it. ... > ruby way of converting these chars into their plain ascii ... QUOTATION MARK don't appear to have any defined Unicode ...
    (comp.lang.ruby)
  • Re: Some interesing aspect of injecting scripts on page...
    ... you have to use Unicode escape sequences for that: ... So the encoding problem is not applicable to the program code itself - ... What happens with the script containing this alert box with a text on ... If you are using only base ASCII characters in your string literals ...
    (comp.lang.javascript)

Loading