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



"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)

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
HQF03250@xxxxxxxxxxx

.