How to read UTF-16 files

B

bradamodeo

I am trying to read in text files that are in UTF-16 format, using the
following code:

Dim fso
Dim infile
Set fso = CreateObject("Scripting.FileSystemObject")
Set infile = fso.opentextfile(vFile, ForReading, True)
Do While infile.atendofstream = False
strHoldLine = infile.readline
o
o
o
Loop

This works fine for standard UTF-8 files, but when I try to read
UTF-16 files, I get garbage in the strHoldLine variable. I have
verified through other programs (such as XMLSpy) that the UTF-16 files
are readable, just not by access.

Any help is GREATLY appreciated!


Brad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top