1. Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As LongByVal dwFlags As LongByRef lpMultiByteStr As Any, ByVal cchMultiByte As LongByVal lpWideCharStr As LongByVal cchWideChar As LongAs Long 
  2. Private Const CP_UTF8 = 65001  
  3.  
  4. 'Purpose:Convert Utf8 to Unicode  
  5. Public Function UTF8_Decode(ByVal sUTF8 As StringAs String 
  6.    Dim lngUtf8Size      As Long 
  7.    Dim strBuffer        As String 
  8.    Dim lngBufferSize    As Long 
  9.    Dim lngResult        As Long 
  10.    Dim bytUtf8()        As Byte 
  11.    Dim n                As Long 
  12.    If LenB(sUTF8) = 0 Then Exit Function 
  13.       On Error GoTo EndFunction  
  14.       bytUtf8 = StrConv(sUTF8, vbFromUnicode)  
  15.       lngUtf8Size = UBound(bytUtf8) + 1  
  16.       On Error GoTo 0  
  17.       lngBufferSize = lngUtf8Size * 2  
  18.       strBuffer = String$(lngBufferSize, vbNullChar)  
  19.       'Translate using code page 65001(UTF-8)  
  20.       lngResult = MultiByteToWideChar(CP_UTF8, 0, bytUtf8(0), _  
  21.          lngUtf8Size, StrPtr(strBuffer), lngBufferSize)  
  22.       'Trim result to actual length  
  23.       If lngResult Then 
  24.          UTF8_Decode = Left$(strBuffer, lngResult)  
  25.       End If 
  26. End Function 

 

把你上面获取的内容转一下就行,比如Text1.Text=UTF8_Decode(strResponse)
还可以加多一句InStr(1, strResponse, "charset=utf-8") > 0判断是否是UTF8编码再执行,不是UTF8的就直接显示。 还有些网页编码那里是大写的,要这样写InStr(1, strResponse, "charset=UTF-8") > 0