Option ExplicitPrivate Sub Command1_Click() Dim s As String
s = "%C9%BD%B5%D8%D7%D4%D0%D0%B3%B5"
Dim i As Long Dim ss As String Dim c As String For i = 1 To Len(s) Step 6 c = Chr(Val("&h" & Mid(s, i + 1, 2)) * 256 + Val("&h" & Mid(s, i + 4, 2))) ss = ss & c Next i
Debug.Print ss End Sub
Public Function Get_Hanzi(Byval strSource As String) As String Dim i As Integer, strTmp As String, strResult As StringstrTmp = Replace(strSource, "%", "") For i = 1 To Len(strTmp) Step 4 strResult = strResult & Chr(Val("&H" & Mid(strTmp, i, 4))) Next i Get_Hanzi = strResult End Function在立即窗口调用: ?get_hanzi("%C9%BD%B5%D8%D7%D4%D0%D0%B3%B5") 山地自行车
Dim s As String
s = "%C9%BD%B5%D8%D7%D4%D0%D0%B3%B5"
Dim i As Long
Dim ss As String
Dim c As String
For i = 1 To Len(s) Step 6
c = Chr(Val("&h" & Mid(s, i + 1, 2)) * 256 + Val("&h" & Mid(s, i + 4, 2)))
ss = ss & c
Next i
Debug.Print ss
End Sub
Public Function Get_Hanzi(Byval strSource As String) As String
Dim i As Integer, strTmp As String, strResult As StringstrTmp = Replace(strSource, "%", "")
For i = 1 To Len(strTmp) Step 4
strResult = strResult & Chr(Val("&H" & Mid(strTmp, i, 4)))
Next i
Get_Hanzi = strResult
End Function在立即窗口调用:
?get_hanzi("%C9%BD%B5%D8%D7%D4%D0%D0%B3%B5")
山地自行车