我的用法如下,strRequest 就为输入的字符串,strRequest2 为输出的字符串
你看看问题在什么地方?期待你的回答,谢谢
Public Sub CheckResult(strRequest As String)
Dim lresult As Long
Dim strRequest2 As String
Dim lLength As Long
Dim lBufferSize As Long
Dim bUTF8() As Byte
bUTF8() = StrConv(strRequest, vbFromUnicode)
lLength = UBound(bUTF8) + 1
lBufferSize = lLength * 2
strRequest2 = String$(lBufferSize, Chr(0))
lresult = MultiByteToWideChar(CP_UTF8, 0, VarPtr(bUTF8(0)), lLength, StrPtr(strRequest2), lBufferSize)
end sub
Public Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpMultiByteStr As Long, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
Public Const CP_UTF8 = 65001
Public Function UTF8_Decode(bUTF8() As Byte) As String
Dim lRet As Long
Dim lLen As Long
Dim lBufferSize As Long
Dim sBuffer As String
Dim bBuffer() As Byte