vb6怎么将Unicode转中文

图片说明
想将出参内的Unicode码转中文 哪位大神知道指点指点

https://stackoverflow.com/questions/14080723/how-to-display-unicode-characters-in-vb6

http://www.cnblogs.com/IDqq/archive/2009/04/22/367412.html

 Public Function DecodeURIComponent(ByVal szStr As String)
  Dim vChars()
  Dim i As Long
  Dim ch As Integer
  Dim ch2 As Integer
  Dim szPartChar As String
  Dim aPartChar() As Byte

  For i = 1 To Len(szStr)
    ch = Asc(Mid$(szStr, i, 1))
    ch2 = Asc(Mid$(szStr, i + 1, 1))
    If ch = 37 And ch2 <> 117 Then 'ch='%' and ch<>'%u'
      If SafeArrayGetDim(aPartChar) = 0 Then
        ReDim aPartChar(0) As Byte
      Else
        ReDim Preserve aPartChar(UBound(aPartChar) + 1) As Byte
      End If
      aPartChar(UBound(aPartChar)) = CLng("&H" & Mid$(szStr, i + 1, 2))
      i = i + 2
    Else
      If SafeArrayGetDim(aPartChar) <> 0 Then
        DecodeURIComponent = DecodeURIComponent & CStr(UTF2StringBytes(aPartChar))
        Erase aPartChar
      End If
      If ch = 37 And ch2 = 117 Then
        DecodeURIComponent = DecodeURIComponent & ChrW(CLng("&H" & Mid$(szStr, i + 2, 4)))
        i = i + 5
      Else
        If ch = 43 Then 'ch='+'
          DecodeURIComponent = DecodeURIComponent & " "
        Else
          DecodeURIComponent = DecodeURIComponent & Chr$(ch)
        End If
      End If
    End If
  Next i

  If SafeArrayGetDim(aPartChar) <> 0 Then
    DecodeURIComponent = DecodeURIComponent & CStr(UTF2StringBytes(aPartChar))
  End If
End Function


Public Function UTF2StringBytes(ByVal sData As String) As Byte()

  Dim aRetn() As Byte
  Dim nSize   As Long

  nSize = MultiByteToWideChar(CP_UTF8, 0, StrPtr(sData), -1, 0, 0) - 1

  If nSize = 0 Then Exit Function
  ReDim aRetn(0 To 2 * nSize - 1) As Byte
  MultiByteToWideChar CP_UTF8, 0, StrPtr(sData), -1, VarPtr(aRetn(0)), nSize
  UTF2StringBytes = aRetn
End Function