Private Declare Function MultiByteToWideChar Lib "kernel32"(ByVal CodePage As Long, ByVal dwFlags As Long, ByVallpMultiByteStr As Long, ByVal cchMultiByte As Long, ByVallpWideCharStr As Long, ByVal cchWideChar As Long) As Long

Private Const CP_UTF8 = 65001

Function Utf8ToUnicode(ByRef Utf() As Byte) As String

Dim lRet As Long

Dim lLength AsLong

Dim lBufferSize AsLong

lLength = UBound(Utf) -LBound(Utf) + 1

If lLength< Then Exit Functiondiv>

lBufferSize = lLength *2

Utf8ToUnicode =String$(lBufferSize, Chr(0))

lRet =MultiByteToWideChar(CP_UTF8, 0, VarPtr(Utf(0)), lLength,StrPtr(Utf8ToUnicode), lBufferSize)

If lRet<> 0 Then

Utf8ToUnicode = Left(Utf8ToUnicode, lRet)

Else

Utf8ToUnicode = ""

End If

End Function

将以上代码放到一个模块中。

private sub command1_click()

Dim b() As Byte

b = Inet1.OpenURL("utf8编码的网址",icByteArray)

msgbox Utf8ToUnicode(b)

end sub