VB读取utf-8文档
Public Function ReadUTF8(ByVal sUTF8File As String) As String
If Len(sUTF8File) = 0 Or Dir(sUTF8File) = vbNullString Then Exit Function
Dim ados As Object
Set ados = CreateObject("adodb.stream")
With ados
.Charset = "utf-8"
.Type = 2
.Open
.LoadFromFile sUTF8File
ReadUTF8 = .ReadText
.Close
End With
Set ados = Nothing
End Function
网友评论