Read UTF-8 File





1
Date Submitted Wed. Mar. 4th, 2009 9:26 PM
Revision 1 of 1
Scripter Cloudgen
Tags "ADODB Stream" | "File Utility" | "VBSCRIPT"
Comments 0 comments
Read all the text from a UTF-8 format file using ADODB.Stream.

' read text from file in utf-8 format
'
Example: content = readUTF_File("/public/test_HTML_E.asp")
Function readUTF_File(FileUrl)
  Set objStream = CreateObject("ADODB.Stream")
  With objStream
    .Charset = "utf-8"
    .Type=2
    .mode=3
    .Open
    .loadfromfile FileUrl
    readUTF_File=.readtext
    .Close
  End With
  Set objStream = Nothing
End Function
 

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Scripter Cloudgen

Votes Down